Module: Buttercoin::Client::OrderMethods
- Included in:
- Buttercoin::Client
- Defined in:
- lib/buttercoin/client/order_methods.rb
Instance Method Summary collapse
-
#cancel_order(orderId, timestamp = nil) ⇒ Object
Cancel order by id.
-
#create_order(options, timestamp = nil) ⇒ Object
Create new order with the given params.
-
#get_order_by_id(orderId, timestamp = nil) ⇒ Object
Retrieve the order by id.
-
#get_order_by_url(url, timestamp = nil) ⇒ Object
Retrieve the order by url.
-
#get_orders(options = {}, timestamp = nil) ⇒ Object
Get list of orders by search criteria.
Instance Method Details
#cancel_order(orderId, timestamp = nil) ⇒ Object
Cancel order by id
60 61 62 |
# File 'lib/buttercoin/client/order_methods.rb', line 60 def cancel_order(orderId, =nil) delete '/orders/'+orderId, end |
#create_order(options, timestamp = nil) ⇒ Object
Create new order with the given params
49 50 51 |
# File 'lib/buttercoin/client/order_methods.rb', line 49 def create_order(, =nil) post '/orders', , end |
#get_order_by_id(orderId, timestamp = nil) ⇒ Object
Retrieve the order by id
12 13 14 |
# File 'lib/buttercoin/client/order_methods.rb', line 12 def get_order_by_id(orderId, =nil) get '/orders/'+orderId, end |
#get_order_by_url(url, timestamp = nil) ⇒ Object
Retrieve the order by url
23 24 25 26 27 28 |
# File 'lib/buttercoin/client/order_methods.rb', line 23 def get_order_by_url(url, =nil) index = url.rindex('/orders') raise Error.new('Url not correctly formatted for orders') if index.nil? path = url[index..-1] get path, end |
#get_orders(options = {}, timestamp = nil) ⇒ Object
Get list of orders by search criteria
37 38 39 40 |
# File 'lib/buttercoin/client/order_methods.rb', line 37 def get_orders(={}, =nil) mash = get '/orders', , mash.results end |