Class: Cargowise::OrderSearch
- Inherits:
-
AbstractSearch
- Object
- AbstractSearch
- Cargowise::OrderSearch
- Defined in:
- lib/cargowise/order_search.rb
Instance Method Summary collapse
-
#by_order_number(ref) ⇒ Object
find all orders with an OrderNumber that matches ref.
-
#by_shipment_number(ref) ⇒ Object
find all orders with a ShipmentNumber that matches ref.
-
#incomplete ⇒ Object
find all orders still marked as incomplete.
Methods inherited from AbstractSearch
Constructor Details
This class inherits a constructor from Cargowise::AbstractSearch
Instance Method Details
#by_order_number(ref) ⇒ Object
find all orders with an OrderNumber that matches ref
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/cargowise/order_search.rb', line 9 def by_order_number(ref) filter_hash = { "tns:Filter" => { "tns:Number" => { "tns:NumberSearchField" => "OrderNumber", "tns:NumberValue" => ref } } } OrdersClient.new.get_order_list(ep.uri, ep.code, ep.user, ep.password, filter_hash) end |
#by_shipment_number(ref) ⇒ Object
find all orders with a ShipmentNumber that matches ref
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cargowise/order_search.rb', line 23 def by_shipment_number(ref) filter_hash = { "tns:Filter" => { "tns:Number" => { "tns:NumberSearchField" => "ShipmentNumber", "tns:NumberValue" => ref } } } OrdersClient.new.get_order_list(ep.uri, ep.code, ep.user, ep.password, filter_hash) end |
#incomplete ⇒ Object
find all orders still marked as incomplete.
37 38 39 40 41 42 |
# File 'lib/cargowise/order_search.rb', line 37 def incomplete filter_hash = { "tns:Filter" => { "tns:OrderStatus" => "INC" } } OrdersClient.new.get_order_list(ep.uri, ep.code, ep.user, ep.password, filter_hash) end |