Class: MBTC::Orderbook

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#asksObject (readonly)

Returns the value of attribute asks.



25
26
27
# File 'lib/mbtc/orderbook.rb', line 25

def asks
  @asks
end

#bidsObject (readonly)

Returns the value of attribute bids.



26
27
28
# File 'lib/mbtc/orderbook.rb', line 26

def bids
  @bids
end