Class: Xolphin::Api::Responses::Invoices

Inherits:
Base
  • Object
show all
Defined in:
lib/xolphin/api/responses/invoices.rb

Instance Method Summary collapse

Methods inherited from Base

#_embedded, #error?, #errors, #limit, #message, #page, #pages, #total

Constructor Details

#initialize(data) ⇒ Invoices

Returns a new instance of Invoices.



5
6
7
# File 'lib/xolphin/api/responses/invoices.rb', line 5

def initialize(data)
  super(data)
end

Instance Method Details

#invoicesObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/xolphin/api/responses/invoices.rb', line 9

def invoices
  @invoices ||= begin
    invoices = []

    if _embedded && _embedded["invoices"]
      _embedded["invoices"].each do |invoice|
        invoices << Invoice.new(invoice)
      end
    end

    invoices
  end
end