Class: Whitehouse::OrderEntry
- Inherits:
-
Object
- Object
- Whitehouse::OrderEntry
- Defined in:
- lib/whitehouse/order_entry.rb
Instance Attribute Summary collapse
-
#entry_id ⇒ Object
Returns the value of attribute entry_id.
-
#orders ⇒ Object
readonly
Returns the value of attribute orders.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ OrderEntry
constructor
A new instance of OrderEntry.
- #to_json ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ OrderEntry
Returns a new instance of OrderEntry.
9 10 11 12 |
# File 'lib/whitehouse/order_entry.rb', line 9 def initialize @orders = [] yield self if block_given? end |
Instance Attribute Details
#entry_id ⇒ Object
Returns the value of attribute entry_id.
6 7 8 |
# File 'lib/whitehouse/order_entry.rb', line 6 def entry_id @entry_id end |
#orders ⇒ Object (readonly)
Returns the value of attribute orders.
7 8 9 |
# File 'lib/whitehouse/order_entry.rb', line 7 def orders @orders end |
Instance Method Details
#to_json ⇒ Object
14 15 16 17 18 |
# File 'lib/whitehouse/order_entry.rb', line 14 def to_json {"EntryID" => entry_id, "Orders" => orders.map(&:order_hash) }.to_json end |