Class: IB::Messages::Incoming::MarketDepth

Inherits:
Object
  • Object
show all
Defined in:
lib/ib/messages/incoming/market_depths.rb

Instance Method Summary collapse

Instance Method Details

#operationObject



21
22
23
# File 'lib/ib/messages/incoming/market_depths.rb', line 21

def operation
  @data[:operation] == 0 ? :insert : @data[:operation] == 1 ? :update : :delete
end

#sideObject



17
18
19
# File 'lib/ib/messages/incoming/market_depths.rb', line 17

def side
  @data[:side] == 0 ? :ask : :bid
end

#to_humanObject



25
26
27
28
# File 'lib/ib/messages/incoming/market_depths.rb', line 25

def to_human
  "<#{self.message_type}: #{operation} #{side} @ "+
      "#{position} = #{price} x #{size}>"
end