Class IB::OutgoingMessages::AbstractMessage
In: messages.rb
Parent: Object

Methods

Public Class methods

[Source]

    # File messages.rb, line 39
39:       def self.message_id
40:         raise Exception("AbstractMessage.message_id called - you need to override this in a subclass.")
41:       end

data is a Hash.

[Source]

    # File messages.rb, line 44
44:       def initialize(data=nil)
45:         @data = StringentHash.new(data)
46:       end

Public Instance methods

This causes the message to send itself over the server socket in server[:socket]. "server" is the @server instance variable from the IB object. You can also use this to e.g. get the server version number.

[Source]

    # File messages.rb, line 51
51:       def send(server)
52:         raise Exception("AbstractMessage.send called - you need to override this in a subclass.")        
53:       end

Protected Instance methods

Returns EOL instead of datum if datum is nil, providing the same functionality as sendMax() in the Java version, which uses Double.MAX_VALUE to mean "item not set" in a variable, and replaces that with EOL on send.

[Source]

    # File messages.rb, line 64
64:       def nilFilter(datum)
65:         datum.nil? ? EOL : datum
66:       end

[Source]

    # File messages.rb, line 58
58:       def requireVersion(server, version)
59:         raise(Exception.new("TWS version >= #{version} required.")) if server[:version] < version
60:       end

[Validate]