Class: Coinone::Public::Orderbook
- Inherits:
-
Object
- Object
- Coinone::Public::Orderbook
- Defined in:
- lib/coinone/public/orderbook.rb,
lib/coinone/public/orderbook/order.rb
Defined Under Namespace
Classes: Order
Instance Attribute Summary collapse
-
#ask ⇒ Object
readonly
Returns the value of attribute ask.
-
#bid ⇒ Object
readonly
Returns the value of attribute bid.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Orderbook
constructor
A new instance of Orderbook.
- #push_orders(params, orders) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Orderbook
Returns a new instance of Orderbook.
9 10 11 12 13 14 15 16 17 |
# File 'lib/coinone/public/orderbook.rb', line 9 def initialize(params={}) @result = params[:result] || nil @ask = [] @bid = [] @timestamp = params[:timestamp].to_i || nil @currency= params[:currency] || nil push_orders(params[:ask], @ask) if params.has_key? :ask push_orders(params[:bid], @bid) if params.has_key? :bid end |
Instance Attribute Details
#ask ⇒ Object (readonly)
Returns the value of attribute ask.
7 8 9 |
# File 'lib/coinone/public/orderbook.rb', line 7 def ask @ask end |
#bid ⇒ Object (readonly)
Returns the value of attribute bid.
7 8 9 |
# File 'lib/coinone/public/orderbook.rb', line 7 def bid @bid end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/coinone/public/orderbook.rb', line 7 def currency @currency end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
6 7 8 |
# File 'lib/coinone/public/orderbook.rb', line 6 def result @result end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
7 8 9 |
# File 'lib/coinone/public/orderbook.rb', line 7 def @timestamp end |