Class: Whitehouse::OrderEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/whitehouse/order_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ OrderEntry

Returns a new instance of OrderEntry.

Yields:

  • (_self)

Yield Parameters:



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_idObject

Returns the value of attribute entry_id.



6
7
8
# File 'lib/whitehouse/order_entry.rb', line 6

def entry_id
  @entry_id
end

#ordersObject (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_jsonObject



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