Class: Bitso::Orders
Instance Attribute Summary
Attributes inherited from Collection
#access_token, #model, #module, #name, #path
Instance Method Summary
collapse
Methods inherited from Collection
#initialize, #update
Instance Method Details
#all(options = {}) ⇒ Object
#buy(options = {}) ⇒ Object
17
18
19
20
|
# File 'lib/bitso/orders.rb', line 17
def buy(options = {})
options.merge!({type: Bitso::Order::BUY})
self.create options
end
|
#create(options = {}) ⇒ Object
#find(order_id) ⇒ Object
22
23
24
25
26
27
|
# File 'lib/bitso/orders.rb', line 22
def find(order_id)
all = self.all
index = all.index {|order| order.id.to_i == order_id}
return all[index] if index
end
|
#sell(options = {}) ⇒ Object
12
13
14
15
|
# File 'lib/bitso/orders.rb', line 12
def sell(options = {})
options.merge!({type: Bitso::Order::SELL})
self.create options
end
|