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, Incoming::AccountMessage, Incoming::ContractMessage, 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).
- .properties? ⇒ Boolean
-
.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.
45 46 47 |
# File 'lib/ib/messages/abstract_message.rb', line 45 def created_at @created_at end |
#data ⇒ Object
Returns the value of attribute data.
45 46 47 |
# File 'lib/ib/messages/abstract_message.rb', line 45 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 |
.properties? ⇒ Boolean
47 48 49 |
# File 'lib/ib/messages/abstract_message.rb', line 47 def self.properties? @given_arguments 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
41 42 43 |
# File 'lib/ib/messages/abstract_message.rb', line 41 def self.class. end |
#request_id ⇒ Object
37 38 39 |
# File 'lib/ib/messages/abstract_message.rb', line 37 def request_id @data[:request_id].presence || nil end |
#to_human ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/ib/messages/abstract_message.rb', line 52 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 |