Class: Cargowise::Invoice

Inherits:
AbstractResult show all
Defined in:
lib/cargowise/invoice.rb

Overview

An invoice that is associated with a Shipment. Not built directly, but available via the invoices() attribute of the Shipment model.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractResult

endpoint, #inspect, register, via

Constructor Details

#initialize(node) ⇒ Invoice

Returns a new instance of Invoice.



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cargowise/invoice.rb', line 15

def initialize(node)
  @node = node

  @number      = text_value("./InvoiceNumber")
  @issuer      = text_value("./IssuerName")
  @date        = time_value("./InvoiceDate")
  @due_date    = time_value("./DueDate")
  @currency    = text_value("./Currency")
  @total       = decimal_value("./TotalAmount")
  @outstanding = decimal_value("./OutstandingAmount")
  @link        = text_value("./Link")
end

Instance Attribute Details

#currencyObject (readonly)

Returns the value of attribute currency.



12
13
14
# File 'lib/cargowise/invoice.rb', line 12

def currency
  @currency
end

#dateObject (readonly)

Returns the value of attribute date.



11
12
13
# File 'lib/cargowise/invoice.rb', line 11

def date
  @date
end

#due_dateObject (readonly)

Returns the value of attribute due_date.



11
12
13
# File 'lib/cargowise/invoice.rb', line 11

def due_date
  @due_date
end

#issuerObject (readonly)

Returns the value of attribute issuer.



11
12
13
# File 'lib/cargowise/invoice.rb', line 11

def issuer
  @issuer
end

Returns the value of attribute link.



13
14
15
# File 'lib/cargowise/invoice.rb', line 13

def link
  @link
end

#numberObject (readonly)

Returns the value of attribute number.



11
12
13
# File 'lib/cargowise/invoice.rb', line 11

def number
  @number
end

#outstandingObject (readonly)

Returns the value of attribute outstanding.



12
13
14
# File 'lib/cargowise/invoice.rb', line 12

def outstanding
  @outstanding
end

#totalObject (readonly)

Returns the value of attribute total.



12
13
14
# File 'lib/cargowise/invoice.rb', line 12

def total
  @total
end

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/cargowise/invoice.rb', line 11

def type
  @type
end