Class: Coinone::Order::CompleteOrders::CompleteOrder

Inherits:
Object
  • Object
show all
Defined in:
lib/coinone/order/complete_orders/complete_order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CompleteOrder

Returns a new instance of CompleteOrder.



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

def initialize(options={})

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


  update_response(options)


end

Instance Attribute Details

#feeObject (readonly)

Returns the value of attribute fee.



9
10
11
# File 'lib/coinone/order/complete_orders/complete_order.rb', line 9

def fee
  @fee
end

#fee_rateObject (readonly)

Returns the value of attribute fee_rate.



9
10
11
# File 'lib/coinone/order/complete_orders/complete_order.rb', line 9

def fee_rate
  @fee_rate
end

#order_idObject (readonly)

Returns the value of attribute order_id.



9
10
11
# File 'lib/coinone/order/complete_orders/complete_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/complete_orders/complete_order.rb', line 9

def price
  @price
end

#qtyObject (readonly)

Returns the value of attribute qty.



9
10
11
# File 'lib/coinone/order/complete_orders/complete_order.rb', line 9

def qty
  @qty
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



9
10
11
# File 'lib/coinone/order/complete_orders/complete_order.rb', line 9

def timestamp
  @timestamp
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/coinone/order/complete_orders/complete_order.rb', line 9

def type
  @type
end

Instance Method Details

#update_response(params = {}) ⇒ Object



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

def update_response(params={})

  @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
  @type = params[:type] if params.has_key? :type
  @fee_rate = params[:feeRate].to_f if params.has_key? :feeRate
  @fee = params[:fee].to_f if params.has_key? :fee
  @order_id = params[:orderId] if params.has_key? :orderId

end