Class: Alegra::Invoices
Instance Attribute Summary
Attributes inherited from Record
Instance Method Summary collapse
-
#create(params) ⇒ Hash
Creates a invoice.
- #find(id) ⇒ Hash
-
#list(params = {}) ⇒ Array
Returs all invoices.
- #send_by_email(id, params) ⇒ Hash
-
#update(id, params) ⇒ Hash
Creates a invoice.
Methods inherited from Record
Constructor Details
This class inherits a constructor from Alegra::Record
Instance Method Details
#create(params) ⇒ Hash
Creates a invoice
45 46 47 48 |
# File 'lib/alegra/invoices.rb', line 45 def create(params) sanitize_params = params.deep_camel_case_lower_keys client.post('invoices', sanitize_params) end |
#find(id) ⇒ Hash
5 6 7 |
# File 'lib/alegra/invoices.rb', line 5 def find(id) client.get("invoices/#{id}") end |
#list(params = {}) ⇒ Array
Returs all invoices
24 25 26 |
# File 'lib/alegra/invoices.rb', line 24 def list(params = {}) client.get('invoices', params) end |
#send_by_email(id, params) ⇒ Hash
78 79 80 81 |
# File 'lib/alegra/invoices.rb', line 78 def send_by_email(id, params) sanitize_params = params.deep_camel_case_lower_keys client.post("invoices/#{id}/email", sanitize_params) end |
#update(id, params) ⇒ Hash
Creates a invoice
67 68 69 70 |
# File 'lib/alegra/invoices.rb', line 67 def update(id, params) sanitize_params = params.deep_camel_case_lower_keys client.put("invoices/#{id}", sanitize_params) end |