Class: IB::IncomingMessages::TickSize

Inherits:
AbstractMessage show all
Defined in:
lib/ib-ruby/messages.rb

Instance Attribute Summary

Attributes inherited from AbstractMessage

#data

Attributes inherited from ExtremelyAbstractMessage

#created_at

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractMessage

inherited, #initialize

Constructor Details

This class inherits a constructor from IB::IncomingMessages::AbstractMessage

Class Method Details

.message_idObject



957
958
959
# File 'lib/ib-ruby/messages.rb', line 957

def self.message_id
  2
end

Instance Method Details

#loadObject



961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
# File 'lib/ib-ruby/messages.rb', line 961

def load
  autoload([:version, :int], [:ticker_id, :int], [:tick_type, :int], [:size, :int])
  @data[:type] = case @data[:tick_type]
                 when 0
                   :bid
                 when 3
                   :ask
                 when 5
                   :last
                 when 8
                   :volume
                 else
                   nil
                 end
end

#to_humanObject



977
978
979
# File 'lib/ib-ruby/messages.rb', line 977

def to_human
  @data[:type].to_s + " size: " +  @data[:size].to_s
end