Class: Flashboy::OrderBook

Inherits:
Object
  • Object
show all
Defined in:
lib/flashboy/order_book.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ OrderBook

Returns a new instance of OrderBook.



5
6
7
8
9
# File 'lib/flashboy/order_book.rb', line 5

def initialize(data)
  @data = data
  @bids = data[:bids].map { |bid| Bid.new(bid) }
  @asks = data[:asks].map { |ask| Ask.new(ask) }
end

Instance Attribute Details

#asksObject (readonly)

Returns the value of attribute asks.



3
4
5
# File 'lib/flashboy/order_book.rb', line 3

def asks
  @asks
end

#bidsObject (readonly)

Returns the value of attribute bids.



3
4
5
# File 'lib/flashboy/order_book.rb', line 3

def bids
  @bids
end

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/flashboy/order_book.rb', line 3

def data
  @data
end