Class: Billomat::Models::Invoice
- Defined in:
- lib/billomat/models/invoice.rb
Overview
Representation of the invoice resource
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.base_path ⇒ String
The resource’s base path.
-
.resource_name ⇒ String
The resource’s name.
Instance Method Summary collapse
-
#cancel! ⇒ Object
Cancels the invoice by calling the Cancel action.
-
#complete! ⇒ Object
Completes the invoice by calling the Complete action.
-
#send_email(recipient) ⇒ Object
Sends the invoice as an email to the given recipient.
-
#to_pdf ⇒ Object
Allows to download the invoice as an PDF.
Methods inherited from Base
#as_json, #create, #delete, find, #id, #initialize, #method_missing, #respond_to_missing?, #save, #update, where, #wrapped_data
Constructor Details
This class inherits a constructor from Billomat::Models::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Billomat::Models::Base
Class Method Details
.base_path ⇒ String
Returns the resource’s base path.
8 9 10 |
# File 'lib/billomat/models/invoice.rb', line 8 def self.base_path '/invoices' end |
.resource_name ⇒ String
Returns the resource’s name.
13 14 15 |
# File 'lib/billomat/models/invoice.rb', line 13 def self.resource_name 'invoice' end |
Instance Method Details
#cancel! ⇒ Object
Cancels the invoice by calling the Cancel action.
23 24 25 |
# File 'lib/billomat/models/invoice.rb', line 23 def cancel! Billomat::Actions::Cancel.new(id).call end |
#complete! ⇒ Object
Completes the invoice by calling the Complete action.
18 19 20 |
# File 'lib/billomat/models/invoice.rb', line 18 def complete! Billomat::Actions::Complete.new(id).call end |