Class: MBTC::Orderbook
- Inherits:
-
Object
- Object
- MBTC::Orderbook
- Defined in:
- lib/mbtc/orderbook.rb
Overview
Orderbook
asks [Array<Order>] lista das ofertas de venda disponíveis. bids [Array<Order>] lista das ofertas de compra disponíveis.
Instance Attribute Summary collapse
-
#asks ⇒ Object
readonly
Returns the value of attribute asks.
-
#bids ⇒ Object
readonly
Returns the value of attribute bids.
Instance Method Summary collapse
-
#initialize(params) ⇒ Orderbook
constructor
A new instance of Orderbook.
Constructor Details
#initialize(params) ⇒ Orderbook
Returns a new instance of Orderbook.
28 29 30 31 32 33 34 35 36 |
# File 'lib/mbtc/orderbook.rb', line 28 def initialize( params ) @asks = params["asks"].collect do |ask| Order.new( ask[0], ask[1] ) end @bids = params["bids"].collect do |bid| Order.new( bid[0], bid[1] ) end end |
Instance Attribute Details
#asks ⇒ Object (readonly)
Returns the value of attribute asks.
25 26 27 |
# File 'lib/mbtc/orderbook.rb', line 25 def asks @asks end |
#bids ⇒ Object (readonly)
Returns the value of attribute bids.
26 27 28 |
# File 'lib/mbtc/orderbook.rb', line 26 def bids @bids end |