Skip to content
This repository was archived by the owner on May 4, 2018. It is now read-only.

Commit 59a87c6

Browse files
author
Jon Allured
committed
added to the basic example to illustrate how serializing the session works
1 parent 1d762ab commit 59a87c6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.rdoc

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ http://developers.dropbox.com
2626
uploaded_file.move 'new_name.txt'
2727
uploaded_file.delete
2828

29+
# STEP 3: Save session for later
30+
File.open('serialized_session.txt', 'w') do |f|
31+
f.puts session.serialize
32+
end
33+
34+
# STEP 4: Play with saved session!
35+
new_session = Dropbox::Session.deserialize(File.read('serialized_session.txt'))
36+
account = new_session.account
37+
puts account.display_name
38+
2939
== Tutorial by Example, Rails Edition
3040

3141
A simple Rails controller that allows a user to first authorize their Dropbox

0 commit comments

Comments
 (0)