Class: IB::IncomingMessages::AbstractMessage
- Inherits:
-
ExtremelyAbstractMessage
- Object
- ExtremelyAbstractMessage
- IB::IncomingMessages::AbstractMessage
- Defined in:
- lib/ib-ruby/messages.rb
Overview
This is just a basic generic message from the server.
Class variables: @@message_id - integer message id.
Instance attributes: :data - Hash of actual data read from a stream.
Override the load(socket) method in your subclass to do actual reading into @data.
Direct Known Subclasses
AccountUpdateTime, AccountValue, BondContractData, ContractData, Error, ExecutionData, HistoricalData, ManagedAccounts, MarketDepth, MarketDepthL2, NewsBulletins, NextValidID, OpenOrder, OrderStatus, PortfolioValue, ReceiveFa, ScannerData, ScannerParameters, TickPrice, TickSize
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Attributes inherited from ExtremelyAbstractMessage
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(socket, server_version) ⇒ AbstractMessage
constructor
A new instance of AbstractMessage.
- #load ⇒ Object
Methods inherited from ExtremelyAbstractMessage
Constructor Details
#initialize(socket, server_version) ⇒ AbstractMessage
Returns a new instance of AbstractMessage.
817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 |
# File 'lib/ib-ruby/messages.rb', line 817 def initialize(socket, server_version) raise Exception.new("Don't use AbstractMessage directly; use the subclass for your specific message type") if self.class.name == "AbstractMessage" #logger.debug(" * loading #{self.class.name}") @created_at = Time.now @data = Hash.new @socket = socket @server_version = server_version self.load() @socket = nil #logger.debug(" * New #{self.class.name}: #{ self.to_human }") end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
810 811 812 |
# File 'lib/ib-ruby/messages.rb', line 810 def data @data end |
Class Method Details
.inherited(by) ⇒ Object
834 835 836 837 |
# File 'lib/ib-ruby/messages.rb', line 834 def AbstractMessage.inherited(by) super(by) Classes.push(by) end |
.message_id ⇒ Object
812 813 814 |
# File 'lib/ib-ruby/messages.rb', line 812 def self. raise Exception("AbstractMessage.message_id called - you need to override this in a subclass.") end |
Instance Method Details
#load ⇒ Object
839 840 841 |
# File 'lib/ib-ruby/messages.rb', line 839 def load raise Exception.new("Don't use AbstractMessage; override load() in a subclass.") end |