Class: Doccy::Documents

Inherits:
Object
  • Object
show all
Defined in:
lib/doccy/documents.rb

Class Method Summary collapse

Class Method Details

.create(auth_token, template_id, document_params) ⇒ Object



5
6
7
8
9
# 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} }

  response = HTTParty.post("#{Doccy::Config.url}/templates/#{template_id}/documents.json", options)
end

.download(auth_token, template_id, document_id) ⇒ Object



17
18
19
20
21
# File 'lib/doccy/documents.rb', line 17

def self.download(auth_token, template_id, document_id)
  options = { query: { auth_token: auth_token} }

  response = HTTParty.get("#{Doccy::Config.url}/templates/#{template_id}/documents/#{document_id}/download.json", options)
end

.get(auth_token, template_id, document_id) ⇒ Object



11
12
13
14
15
# File 'lib/doccy/documents.rb', line 11

def self.get(auth_token, template_id, document_id)
  options = { query: { auth_token: auth_token} }

  response = HTTParty.get("#{Doccy::Config.url}/templates/#{template_id}/documents/#{document_id}.json", options)
end