Class: Invoicer::BlinksaleInvoiceManager

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service) ⇒ BlinksaleInvoiceManager

Returns a new instance of BlinksaleInvoiceManager.



8
9
10
# File 'lib/services/blinksale/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/blinksale/invoice_manager.rb', line 6

def service
  @service
end

Instance Method Details

#all(params = {}) ⇒ Object



12
13
14
15
16
# File 'lib/services/blinksale/invoice_manager.rb', line 12

def all(params = {})
  service.blinksale.all(params).map do |i|
    Invoicer::BlinksaleInvoice.from_blinksale(i)
  end
end

#get(id) ⇒ Object



18
19
20
# File 'lib/services/blinksale/invoice_manager.rb', line 18

def get(id)
  Invoicer::BlinksaleInvoice.from_blinksale(service.blinksale.get(id))
end