Class: Cargowise::Invoice
- Inherits:
-
AbstractResult
- Object
- AbstractResult
- Cargowise::Invoice
- 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
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#due_date ⇒ Object
readonly
Returns the value of attribute due_date.
-
#issuer ⇒ Object
readonly
Returns the value of attribute issuer.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#outstanding ⇒ Object
readonly
Returns the value of attribute outstanding.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(node) ⇒ Invoice
constructor
A new instance of Invoice.
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
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
12 13 14 |
# File 'lib/cargowise/invoice.rb', line 12 def currency @currency end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
11 12 13 |
# File 'lib/cargowise/invoice.rb', line 11 def date @date end |
#due_date ⇒ Object (readonly)
Returns the value of attribute due_date.
11 12 13 |
# File 'lib/cargowise/invoice.rb', line 11 def due_date @due_date end |
#issuer ⇒ Object (readonly)
Returns the value of attribute issuer.
11 12 13 |
# File 'lib/cargowise/invoice.rb', line 11 def issuer @issuer end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
13 14 15 |
# File 'lib/cargowise/invoice.rb', line 13 def link @link end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
11 12 13 |
# File 'lib/cargowise/invoice.rb', line 11 def number @number end |
#outstanding ⇒ Object (readonly)
Returns the value of attribute outstanding.
12 13 14 |
# File 'lib/cargowise/invoice.rb', line 12 def outstanding @outstanding end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
12 13 14 |
# File 'lib/cargowise/invoice.rb', line 12 def total @total end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
11 12 13 |
# File 'lib/cargowise/invoice.rb', line 11 def type @type end |