Class: Coinone::Order
- Inherits:
-
Object
- Object
- Coinone::Order
- Defined in:
- lib/coinone/order.rb,
lib/coinone/order/market_buy.rb,
lib/coinone/order/market_sell.rb,
lib/coinone/order/limit_orders.rb,
lib/coinone/order/trade_response.rb,
lib/coinone/order/complete_orders.rb,
lib/coinone/order/cancel_order_response.rb,
lib/coinone/order/limit_orders/limit_order.rb,
lib/coinone/order/cancel_all_order_response.rb,
lib/coinone/order/complete_orders/complete_order.rb
Defined Under Namespace
Classes: CancelAllOrderResponse, CancelOrderResponse, CompleteOrders, LimitOrders, TradeResponse
Instance Attribute Summary collapse
-
#cancel_all_order_response ⇒ Object
readonly
Returns the value of attribute cancel_all_order_response.
-
#cancel_order_response ⇒ Object
readonly
Returns the value of attribute cancel_order_response.
-
#complete_orders ⇒ Object
readonly
Returns the value of attribute complete_orders.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#limit_buy ⇒ Object
readonly
Returns the value of attribute limit_buy.
-
#limit_orders ⇒ Object
readonly
Returns the value of attribute limit_orders.
-
#limit_sell ⇒ Object
readonly
Returns the value of attribute limit_sell.
-
#market_buy ⇒ Object
readonly
Returns the value of attribute market_buy.
-
#market_sell ⇒ Object
readonly
Returns the value of attribute market_sell.
Instance Method Summary collapse
- #cancel_all_order(options = {}) ⇒ Object
- #cancel_order(options = {}) ⇒ Object
- #get_complete_orders(options = {}) ⇒ Object
- #get_limit_buy(options = {}) ⇒ Object
- #get_limit_orders(options = {}) ⇒ Object
- #get_limit_sell(options = {}) ⇒ Object
- #get_market_buy(options = {}) ⇒ Object
- #get_market_sell(options = {}) ⇒ Object
-
#initialize(options = {}, connection = nil) ⇒ Order
constructor
A new instance of Order.
Constructor Details
#initialize(options = {}, connection = nil) ⇒ Order
Returns a new instance of Order.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/coinone/order.rb', line 16 def initialize(={}, connection=nil) @connection = connection || Connection.factory() @cancel_all_order_response = CancelAllOrderResponse.new() @cancel_order_response = CancelOrderResponse.new() @limit_sell = TradeResponse.new() @limit_buy = TradeResponse.new() @market_sell = TradeResponse.new() @market_buy = TradeResponse.new() @complete_orders = CompleteOrders.new() @limit_orders = LimitOrders.new() end |
Instance Attribute Details
#cancel_all_order_response ⇒ Object (readonly)
Returns the value of attribute cancel_all_order_response.
12 13 14 |
# File 'lib/coinone/order.rb', line 12 def cancel_all_order_response @cancel_all_order_response end |
#cancel_order_response ⇒ Object (readonly)
Returns the value of attribute cancel_order_response.
12 13 14 |
# File 'lib/coinone/order.rb', line 12 def cancel_order_response @cancel_order_response end |
#complete_orders ⇒ Object (readonly)
Returns the value of attribute complete_orders.
13 14 15 |
# File 'lib/coinone/order.rb', line 13 def complete_orders @complete_orders end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
11 12 13 |
# File 'lib/coinone/order.rb', line 11 def connection @connection end |
#limit_buy ⇒ Object (readonly)
Returns the value of attribute limit_buy.
12 13 14 |
# File 'lib/coinone/order.rb', line 12 def limit_buy @limit_buy end |
#limit_orders ⇒ Object (readonly)
Returns the value of attribute limit_orders.
13 14 15 |
# File 'lib/coinone/order.rb', line 13 def limit_orders @limit_orders end |
#limit_sell ⇒ Object (readonly)
Returns the value of attribute limit_sell.
12 13 14 |
# File 'lib/coinone/order.rb', line 12 def limit_sell @limit_sell end |
#market_buy ⇒ Object (readonly)
Returns the value of attribute market_buy.
13 14 15 |
# File 'lib/coinone/order.rb', line 13 def market_buy @market_buy end |
#market_sell ⇒ Object (readonly)
Returns the value of attribute market_sell.
13 14 15 |
# File 'lib/coinone/order.rb', line 13 def market_sell @market_sell end |
Instance Method Details
#cancel_all_order(options = {}) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/coinone/order.rb', line 31 def cancel_all_order(={}) [:currency] = "btc" if [:currency].blank? response = @connection.post( "/v2/order/cancel_all/", ) @cancel_all_order_response.update_response(response) @cancel_all_order_response end |
#cancel_order(options = {}) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/coinone/order.rb', line 40 def cancel_order(={}) [:currency] = "btc" if [:currency].blank? response = @connection.post( "/v2/order/cancel/", ) @cancel_order_response.update_response(response) @cancel_order_response end |
#get_complete_orders(options = {}) ⇒ Object
85 86 87 88 89 90 91 92 93 |
# File 'lib/coinone/order.rb', line 85 def get_complete_orders(={}) [:currency] = "btc" if [:currency].blank? response = @connection.post( "/v2/order/complete_orders/", ) @complete_orders.update_response(response) @complete_orders end |
#get_limit_buy(options = {}) ⇒ Object
58 59 60 61 62 63 64 65 |
# File 'lib/coinone/order.rb', line 58 def get_limit_buy( = {}) [:currency] = "btc" if [:currency].blank? response = @connection.post( "/v2/order/limit_buy/", ) @limit_buy.update_response(response) @limit_buy end |
#get_limit_orders(options = {}) ⇒ Object
96 97 98 99 100 101 102 103 |
# File 'lib/coinone/order.rb', line 96 def get_limit_orders(={}) [:currency] = "btc" if [:currency].blank? response = @connection.post( "/v2/order/limit_orders/", ) @limit_orders.update_response(response) @limit_orders end |
#get_limit_sell(options = {}) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/coinone/order.rb', line 49 def get_limit_sell(={}) [:currency] = "btc" if [:currency].blank? response = @connection.post( "/v2/order/limit_sell/", ) @limit_sell.update_response(response) @limit_sell end |
#get_market_buy(options = {}) ⇒ Object
67 68 69 70 71 72 73 74 |
# File 'lib/coinone/order.rb', line 67 def get_market_buy(={}) [:currency] = "btc" if [:currency].blank? response = @connection.post( "/v2/order/market_buy/", ) @market_buy.update_response(response) @market_buy end |
#get_market_sell(options = {}) ⇒ Object
76 77 78 79 80 81 82 83 |
# File 'lib/coinone/order.rb', line 76 def get_market_sell(={}) [:currency] = "btc" if [:currency].blank? response = @connection.post( "/v2/order/market_sell/", ) @market_sell.update_response(response) @market_sell end |