Class: Whitehouse::Order
- Inherits:
-
Object
- Object
- Whitehouse::Order
- Defined in:
- lib/whitehouse/order.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#drop_ship ⇒ Object
Returns the value of attribute drop_ship.
-
#entry_id ⇒ Object
Returns the value of attribute entry_id.
-
#from_address ⇒ Object
writeonly
Sets the attribute from_address.
-
#from_address_value ⇒ Object
Returns the value of attribute from_address_value.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#order_attributes ⇒ Object
writeonly
Sets the attribute order_attributes.
-
#sequence_number ⇒ Object
Returns the value of attribute sequence_number.
-
#to_address ⇒ Object
writeonly
Sets the attribute to_address.
Instance Method Summary collapse
- #add_item(item) ⇒ Object
-
#initialize {|_self| ... } ⇒ Order
constructor
A new instance of Order.
- #to_json ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Order
Returns a new instance of Order.
10 11 12 13 |
# File 'lib/whitehouse/order.rb', line 10 def initialize defaults yield self if block_given? end |
Instance Attribute Details
#drop_ship ⇒ Object
Returns the value of attribute drop_ship.
6 7 8 |
# File 'lib/whitehouse/order.rb', line 6 def drop_ship @drop_ship end |
#entry_id ⇒ Object
Returns the value of attribute entry_id.
6 7 8 |
# File 'lib/whitehouse/order.rb', line 6 def entry_id @entry_id end |
#from_address=(value) ⇒ Object
Sets the attribute from_address
6 7 8 |
# File 'lib/whitehouse/order.rb', line 6 def from_address=(value) @from_address = value end |
#from_address_value ⇒ Object
Returns the value of attribute from_address_value.
6 7 8 |
# File 'lib/whitehouse/order.rb', line 6 def from_address_value @from_address_value end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
8 9 10 |
# File 'lib/whitehouse/order.rb', line 8 def items @items end |
#order_attributes=(value) ⇒ Object
Sets the attribute order_attributes
6 7 8 |
# File 'lib/whitehouse/order.rb', line 6 def order_attributes=(value) @order_attributes = value end |
#sequence_number ⇒ Object
Returns the value of attribute sequence_number.
6 7 8 |
# File 'lib/whitehouse/order.rb', line 6 def sequence_number @sequence_number end |
#to_address=(value) ⇒ Object
Sets the attribute to_address
6 7 8 |
# File 'lib/whitehouse/order.rb', line 6 def to_address=(value) @to_address = value end |
Instance Method Details
#add_item(item) ⇒ Object
53 54 55 |
# File 'lib/whitehouse/order.rb', line 53 def add_item(item) @items << item end |
#to_json ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/whitehouse/order.rb', line 57 def to_json {"EntryID" => entry_id, "Orders" => [ {"DropShipFlag" => drop_ship, "FromAddressValue" => from_address_value, "OrderAttributes" => order_attributes, # "Reference" => reference, # "Instructions" => instructions, "SequenceNumber" => sequence_number, "ShipToAddress" => to_address, # "ShipFromAddress" => from_address, "OrderItems" => order_items } ] }.to_json end |