Class: Coinone::Public::CompleteOrders
- Inherits:
-
Object
- Object
- Coinone::Public::CompleteOrders
- Defined in:
- lib/coinone/public/complete_orders.rb,
lib/coinone/public/complete_orders/complete_order.rb
Defined Under Namespace
Classes: CompleteOrder
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#orders ⇒ Object
readonly
Returns the value of attribute orders.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ CompleteOrders
constructor
A new instance of CompleteOrders.
- #push_orders(params) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ CompleteOrders
Returns a new instance of CompleteOrders.
9 10 11 12 13 14 15 |
# File 'lib/coinone/public/complete_orders.rb', line 9 def initialize(params={}) @result = params[:result] || nil @orders = [] @timestamp = params[:timestamp] || nil @currency= params[:currency] || nil push_orders(params[:completeOrders]) if params.has_key? :completeOrders end |
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/coinone/public/complete_orders.rb', line 7 def currency @currency end |
#orders ⇒ Object (readonly)
Returns the value of attribute orders.
7 8 9 |
# File 'lib/coinone/public/complete_orders.rb', line 7 def orders @orders end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
6 7 8 |
# File 'lib/coinone/public/complete_orders.rb', line 6 def result @result end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
7 8 9 |
# File 'lib/coinone/public/complete_orders.rb', line 7 def @timestamp end |
Instance Method Details
#push_orders(params) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/coinone/public/complete_orders.rb', line 17 def push_orders(params) @orders.clear params.each do |order| @orders.push(CompleteOrder.new(order)) end end |