Class: IB::Messages::AbstractMessage
- Defined in:
- lib/ib/messages/abstract_message.rb
Overview
This is just a basic generic message from the server.
Class variables: Instance attributes (at least):
Direct Known Subclasses
Incoming::AbstractMessage, Outgoing::AbstractMessage, Outgoing::BarRequestMessage
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#data ⇒ Object
Returns the value of attribute data.
Class Method Summary collapse
-
.data_map ⇒ Object
Class methods.
- .message_id ⇒ Object
-
.message_type ⇒ Object
Returns message type Symbol (e.g. :OpenOrderEnd).
-
.version ⇒ Object
Per class, minimum message version supported.
Instance Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
41 42 43 |
# File 'lib/ib/messages/abstract_message.rb', line 41 def created_at @created_at end |
#data ⇒ Object
Returns the value of attribute data.
41 42 43 |
# File 'lib/ib/messages/abstract_message.rb', line 41 def data @data end |
Class Method Details
.data_map ⇒ Object
Class methods
16 17 18 |
# File 'lib/ib/messages/abstract_message.rb', line 16 def self.data_map # Map for converting between structured message and raw data @data_map ||= [] end |
.message_id ⇒ Object
24 25 26 |
# File 'lib/ib/messages/abstract_message.rb', line 24 def self. @message_id end |
.message_type ⇒ Object
Returns message type Symbol (e.g. :OpenOrderEnd)
29 30 31 |
# File 'lib/ib/messages/abstract_message.rb', line 29 def self. to_s.split(/::/).last.to_sym end |
.version ⇒ Object
Per class, minimum message version supported
20 21 22 |
# File 'lib/ib/messages/abstract_message.rb', line 20 def self.version # Per class, minimum message version supported @version || 1 end |
Instance Method Details
#message_id ⇒ Object
33 34 35 |
# File 'lib/ib/messages/abstract_message.rb', line 33 def self.class. end |
#message_type ⇒ Object
37 38 39 |
# File 'lib/ib/messages/abstract_message.rb', line 37 def self.class. end |
#to_human ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/ib/messages/abstract_message.rb', line 43 def to_human "<#{self.}:" + @data.map do |key, value| unless [:version].include?(key) " #{key} #{ value.is_a?(Hash) ? value.inspect : value}" end end.compact.join(',') + " >" end |