Class: CargowiseTS::Order
- Inherits:
-
AbstractResult
- Object
- AbstractResult
- CargowiseTS::Order
- Defined in:
- lib/cargowise-ts/order.rb
Overview
A purchase order that is being shipped to from a supplier to you via a logistics company.
Typcially you will setup an arrangement with your account manager where they are sent copies of POs so they can be entered into the database and tracked.
All order objects are read-only, see the object attributes to see what information is available.
Use class find methods to retrieve order info from your logistics company.
Order.find_by_order_number(...)
Order.find_incomplete(...)
etc
Instance Attribute Summary collapse
-
#buyer_name ⇒ Object
readonly
Returns the value of attribute buyer_name.
-
#container_mode ⇒ Object
readonly
Returns the value of attribute container_mode.
-
#datetime ⇒ Object
readonly
Returns the value of attribute datetime.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#invoice_number ⇒ Object
readonly
Returns the value of attribute invoice_number.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#order_status ⇒ Object
readonly
Returns the value of attribute order_status.
-
#order_total ⇒ Object
readonly
Returns the value of attribute order_total.
-
#shipments ⇒ Object
readonly
Returns the value of attribute shipments.
-
#supplier_name ⇒ Object
readonly
Returns the value of attribute supplier_name.
-
#transport_mode ⇒ Object
readonly
Returns the value of attribute transport_mode.
Instance Method Summary collapse
-
#initialize(node) ⇒ Order
constructor
A new instance of Order.
- #to_xml ⇒ Object
Methods inherited from AbstractResult
Constructor Details
#initialize(node) ⇒ Order
Returns a new instance of Order.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/cargowise-ts/order.rb', line 37 def initialize(node) @node = node @order_number = text_value("./OrderIdentifier/OrderNumber") @invoice_number = text_value("./OrderDetail/InvoiceNumber") @order_status = text_value("./OrderDetail/OrderStatus") @description = text_value("./OrderDetail/Description") @datetime = time_value("./OrderDetail/OrderDateTime") @order_total = decimal_value("./OrderDetail/OrderTotal") @transport_mode = text_value("./OrderDetail/TransportMode") @container_mode = text_value("./OrderDetail/ContainerMode") @buyer_name = text_value("./OrderDetail/Buyer/OrganisationDetails/Name") @supplier_name = text_value("./OrderDetail/Supplier/OrganisationDetails/Name") @shipments = node_array("./Shipment").map { |node| Shipment.new(node) } end |
Instance Attribute Details
#buyer_name ⇒ Object (readonly)
Returns the value of attribute buyer_name.
31 32 33 |
# File 'lib/cargowise-ts/order.rb', line 31 def buyer_name @buyer_name end |
#container_mode ⇒ Object (readonly)
Returns the value of attribute container_mode.
28 29 30 |
# File 'lib/cargowise-ts/order.rb', line 28 def container_mode @container_mode end |
#datetime ⇒ Object (readonly)
Returns the value of attribute datetime.
27 28 29 |
# File 'lib/cargowise-ts/order.rb', line 27 def datetime @datetime end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
27 28 29 |
# File 'lib/cargowise-ts/order.rb', line 27 def description @description end |
#invoice_number ⇒ Object (readonly)
Returns the value of attribute invoice_number.
29 30 31 |
# File 'lib/cargowise-ts/order.rb', line 29 def invoice_number @invoice_number end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
27 28 29 |
# File 'lib/cargowise-ts/order.rb', line 27 def order_number @order_number end |
#order_status ⇒ Object (readonly)
Returns the value of attribute order_status.
27 28 29 |
# File 'lib/cargowise-ts/order.rb', line 27 def order_status @order_status end |
#order_total ⇒ Object (readonly)
Returns the value of attribute order_total.
28 29 30 |
# File 'lib/cargowise-ts/order.rb', line 28 def order_total @order_total end |
#shipments ⇒ Object (readonly)
Returns the value of attribute shipments.
35 36 37 |
# File 'lib/cargowise-ts/order.rb', line 35 def shipments @shipments end |
#supplier_name ⇒ Object (readonly)
Returns the value of attribute supplier_name.
33 34 35 |
# File 'lib/cargowise-ts/order.rb', line 33 def supplier_name @supplier_name end |
#transport_mode ⇒ Object (readonly)
Returns the value of attribute transport_mode.
28 29 30 |
# File 'lib/cargowise-ts/order.rb', line 28 def transport_mode @transport_mode end |
Instance Method Details
#to_xml ⇒ Object
58 59 60 |
# File 'lib/cargowise-ts/order.rb', line 58 def to_xml @node.to_xml end |