Class: Bitex::OrderBase
- Inherits:
-
Object
- Object
- Bitex::OrderBase
- Defined in:
- lib/bitex/order.rb
Overview
Base class for Bids and Asks
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#price ⇒ Object
Returns the value of attribute price.
-
#specie ⇒ Object
Returns the value of attribute specie.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
-
.active ⇒ Object
Returns an array with all your active orders of this type Uses Bitex::Order.active under the hood.
-
.all ⇒ Object
Returns an array with all your active orders of this type, and any other order of this type that was active in the last 2 hours.
-
.find(id) ⇒ Object
Find an order in your list of active orders.
Instance Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/bitex/order.rb', line 6 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/bitex/order.rb', line 5 def id @id end |
#price ⇒ Object
Returns the value of attribute price.
8 9 10 |
# File 'lib/bitex/order.rb', line 8 def price @price end |
#specie ⇒ Object
Returns the value of attribute specie.
7 8 9 |
# File 'lib/bitex/order.rb', line 7 def specie @specie end |
#status ⇒ Object
Returns the value of attribute status.
9 10 11 |
# File 'lib/bitex/order.rb', line 9 def status @status end |
Class Method Details
.active ⇒ Object
Returns an array with all your active orders of this type Uses Bitex::Order.active under the hood.
20 21 22 |
# File 'lib/bitex/order.rb', line 20 def self.active Order.active.select{|o| o.is_a?(self) } end |
.all ⇒ Object
Returns an array with all your active orders of this type, and any other order of this type that was active in the last 2 hours. Uses Bitex::Order.all under the hood.
14 15 16 |
# File 'lib/bitex/order.rb', line 14 def self.all Order.all.select{|o| o.is_a?(self) } end |
.find(id) ⇒ Object
Find an order in your list of active orders. Uses Bitex::Order.active under the hood.
26 27 28 |
# File 'lib/bitex/order.rb', line 26 def self.find(id) all.select{|o| o.id == id}.first end |