Skip to content

Commit c2d3d22

Browse files
author
alex.khalevine
committed
improved download document example
1 parent fb22ef0 commit c2d3d22

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/download_document.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
client = Eversign::Client.new
44

5-
for document in client.get_all_documents()
6-
client.download_raw_document_to_path(document.document_hash, 'raw.pdf')
7-
client.download_final_document_to_path(document.document_hash, 'final.pdf')
8-
break
9-
end
5+
documents = client.get_all_documents()
6+
7+
# paradox discovered: documents.first is actually last added document
8+
document = documents.first
9+
10+
client.download_raw_document_to_path(document.document_hash, 'raw.pdf')
11+
client.download_final_document_to_path(document.document_hash, 'final.pdf')

0 commit comments

Comments
 (0)