Class: Invoicer::HarvestInvoiceManager
- Inherits:
-
Object
- Object
- Invoicer::HarvestInvoiceManager
- Defined in:
- lib/services/harvest/invoice_manager.rb
Instance Attribute Summary collapse
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #all(params = {}) ⇒ Object
- #get(id) ⇒ Object
-
#initialize(service) ⇒ HarvestInvoiceManager
constructor
A new instance of HarvestInvoiceManager.
Constructor Details
#initialize(service) ⇒ HarvestInvoiceManager
Returns a new instance of HarvestInvoiceManager.
8 9 10 |
# File 'lib/services/harvest/invoice_manager.rb', line 8 def initialize(service) @service = service end |
Instance Attribute Details
#service ⇒ Object (readonly)
Returns the value of attribute service.
6 7 8 |
# File 'lib/services/harvest/invoice_manager.rb', line 6 def service @service end |
Instance Method Details
#all(params = {}) ⇒ Object
12 13 14 15 16 |
# File 'lib/services/harvest/invoice_manager.rb', line 12 def all(params = {}) service.harvester.all(params).map do |i| Invoicer::HarvestInvoice.from_harvest(i) end end |
#get(id) ⇒ Object
18 19 20 |
# File 'lib/services/harvest/invoice_manager.rb', line 18 def get(id) Invoicer::HarvestInvoice.from_harvest(service.harvester.get(id)) end |