Class: Coinone::Order::LimitOrders::LimitOrder

Inherits:
Object
  • Object
show all
Defined in:
lib/coinone/order/limit_orders/limit_order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ LimitOrder

Returns a new instance of LimitOrder.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/coinone/order/limit_orders/limit_order.rb', line 11

def initialize(options={})

  @index = nil
  @timestamp = nil
  @price = nil
  @type = nil
  @qty = nil
  @fee_rate = nil
  @order_id = nil

  update_response(options)


end

Instance Attribute Details

#fee_rateObject (readonly)

Returns the value of attribute fee_rate.



9
10
11
# File 'lib/coinone/order/limit_orders/limit_order.rb', line 9

def fee_rate
  @fee_rate
end

#indexObject (readonly)

Returns the value of attribute index.



9
10
11
# File 'lib/coinone/order/limit_orders/limit_order.rb', line 9

def index
  @index
end

#order_idObject (readonly)

Returns the value of attribute order_id.



9
10
11
# File 'lib/coinone/order/limit_orders/limit_order.rb', line 9

def order_id
  @order_id
end

#priceObject (readonly)

Returns the value of attribute price.



9
10
11
# File 'lib/coinone/order/limit_orders/limit_order.rb', line 9

def price
  @price
end

#qtyObject (readonly)

Returns the value of attribute qty.



9
10
11
# File 'lib/coinone/order/limit_orders/limit_order.rb', line 9

def qty
  @qty
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



9
10
11
# File 'lib/coinone/order/limit_orders/limit_order.rb', line 9

def timestamp
  @timestamp
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/coinone/order/limit_orders/limit_order.rb', line 9

def type
  @type
end

Instance Method Details

#update_response(params = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/coinone/order/limit_orders/limit_order.rb', line 26

def update_response(params={})


  @index = params[:index].to_i if params.has_key? :index
  @timestamp = params[:timestamp].to_i if params.has_key? :timestamp
  @price = params[:price].to_i if params.has_key? :price
  @qty = params[:qty].to_f if params.has_key? :qty
  @order_id = params[:orderId] if params.has_key? :orderId
  @type = params[:type] if params.has_key? :type
  @fee_rate = params[:feeRate].to_f if params.has_key? :feeRate

end