Class: Invoicer::HarvestInvoiceManager

Inherits:
Object
  • Object
show all
Defined in:
lib/services/harvest/invoice_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#serviceObject (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