Class: Invoicer::FreshbooksInvoiceManager
- Inherits:
-
Object
- Object
- Invoicer::FreshbooksInvoiceManager
- Defined in:
- lib/services/freshbooks/invoice_manager.rb
Instance Attribute Summary collapse
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #all ⇒ Object
- #get(id) ⇒ Object
-
#initialize(service) ⇒ FreshbooksInvoiceManager
constructor
A new instance of FreshbooksInvoiceManager.
Constructor Details
#initialize(service) ⇒ FreshbooksInvoiceManager
Returns a new instance of FreshbooksInvoiceManager.
7 8 9 |
# File 'lib/services/freshbooks/invoice_manager.rb', line 7 def initialize(service) @service = service end |
Instance Attribute Details
#service ⇒ Object (readonly)
Returns the value of attribute service.
5 6 7 |
# File 'lib/services/freshbooks/invoice_manager.rb', line 5 def service @service end |
Instance Method Details
#all ⇒ Object
11 12 13 14 15 |
# File 'lib/services/freshbooks/invoice_manager.rb', line 11 def all service.freshbooks.invoice.list["invoices"]["invoice"].map do |i| Invoicer::FreshbooksInvoice.from_freshbooks(i) end end |
#get(id) ⇒ Object
17 18 19 20 |
# File 'lib/services/freshbooks/invoice_manager.rb', line 17 def get(id) hash = service.freshbooks.invoice.get(:invoice_id => id)["invoice"] Invoicer::FreshbooksInvoice.from_freshbooks(hash) end |