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

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

Instance Attribute Summary

Attributes inherited from AbstractMessage

#buffer

Attributes inherited from AbstractMessage

#created_at, #data

Instance Method Summary collapse

Methods inherited from AbstractMessage

#check_version, #initialize, #load, #load_map, #simple_load, #valid?, #version

Methods inherited from AbstractMessage

data_map, message_id, #message_id, message_type, #message_type, properties?, #request_id, version

Constructor Details

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

Instance Method Details

#the_dataObject



19
20
21
# File 'lib/ib/messages/incoming/ticks.rb', line 19

def the_data
	@data.reject{|k,_| [:version, :ticker_id].include? k }
end

#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