Class: IB::Messages::Incoming::AbstractTick

Inherits:
AbstractMessage show all
Defined in:
lib/ib/messages/incoming/ticks.rb

Instance Attribute Summary

Attributes inherited from AbstractMessage

#socket

Attributes inherited from AbstractMessage

#created_at, #data

Instance Method Summary collapse

Methods inherited from AbstractMessage

#check_version, #initialize, #load, #load_map, #version

Methods inherited from AbstractMessage

data_map, message_id, #message_id, message_type, #message_type, version

Constructor Details

This class inherits a constructor from IB::Messages::Incoming::AbstractMessage

Instance Method Details

#to_humanObject



12
13
14
15
16
17
# File 'lib/ib/messages/incoming/ticks.rb', line 12

def to_human
  "<#{self.message_type} #{type}:" +
      @data.map do |key, value|
        " #{key} #{value}" unless [:version, :ticker_id, :tick_type].include?(key)
      end.compact.join(',') + " >"
end

#typeObject

Returns Symbol with a meaningful name for received tick type



8
9
10
# File 'lib/ib/messages/incoming/ticks.rb', line 8

def type
  TICK_TYPES[@data[:tick_type]]
end