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



8
9
10
11
12
13
# File 'lib/coinone/public/complete_orders.rb', line 8

def initialize(params={})
  @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.



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

def currency
  @currency
end

#ordersObject (readonly)

Returns the value of attribute orders.



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

def orders
  @orders
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

Instance Method Details

#push_orders(params) ⇒ Object



15
16
17
18
19
# File 'lib/coinone/public/complete_orders.rb', line 15

def push_orders(params)
  params.each do |order|
    @orders.push(CompleteOrder.new(order))
  end
end