Class: Coinone::Public::CompleteOrders

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#currencyObject (readonly)

Returns the value of attribute currency.



7
8
9
# File 'lib/coinone/public/complete_orders.rb', line 7

def currency
  @currency
end

#ordersObject (readonly)

Returns the value of attribute orders.



7
8
9
# File 'lib/coinone/public/complete_orders.rb', line 7

def orders
  @orders
end

#resultObject (readonly)

Returns the value of attribute result.



6
7
8
# File 'lib/coinone/public/complete_orders.rb', line 6

def result
  @result
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



7
8
9
# File 'lib/coinone/public/complete_orders.rb', line 7

def timestamp
  @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