Class: Doccy::Documents
- Inherits:
-
Object
- Object
- Doccy::Documents
- Defined in:
- lib/doccy/documents.rb
Class Method Summary collapse
- .create(auth_token, template_id, document_params) ⇒ Object
- .download(auth_token, template_id, document_id, original = nil) ⇒ Object
- .get(auth_token, template_id, document_id) ⇒ Object
Class Method Details
.create(auth_token, template_id, document_params) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/doccy/documents.rb', line 5 def self.create(auth_token, template_id, document_params) # options = { query: { auth_token: auth_token, document: document_params} } = { body: { auth_token: auth_token, document: document_params} } response = HTTParty.post("#{Doccy::Config.url}/templates/#{template_id}/documents.json", ) end |
.download(auth_token, template_id, document_id, original = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/doccy/documents.rb', line 18 def self.download(auth_token, template_id, document_id, original=nil) if original = { query: { auth_token: auth_token, original: true} } else = { query: { auth_token: auth_token} } end response = HTTParty.get("#{Doccy::Config.url}/templates/#{template_id}/documents/#{document_id}/download.json", ) end |
.get(auth_token, template_id, document_id) ⇒ Object
12 13 14 15 16 |
# File 'lib/doccy/documents.rb', line 12 def self.get(auth_token, template_id, document_id) = { query: { auth_token: auth_token} } response = HTTParty.get("#{Doccy::Config.url}/templates/#{template_id}/documents/#{document_id}.json", ) end |