Class: IB::OutgoingMessages::RequestContractData

Inherits:
AbstractMessage show all
Defined in:
lib/ib-ruby/messages.rb

Overview

data => { :contract => Contract }

Instance Attribute Summary

Attributes inherited from ExtremelyAbstractMessage

#created_at

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractMessage

#initialize, #send

Methods inherited from ExtremelyAbstractMessage

#to_human

Constructor Details

This class inherits a constructor from IB::OutgoingMessages::AbstractMessage

Class Method Details

.message_idObject



338
339
340
# File 'lib/ib-ruby/messages.rb', line 338

def self.message_id
  9
end

Instance Method Details

#queue(server) ⇒ Object



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/ib-ruby/messages.rb', line 342

def queue(server)
  requireVersion(server, 4)

  queue = [
           self.class.message_id,
           2, # version
           @data[:contract].symbol,
           @data[:contract].sec_type,
           @data[:contract].expiry,
           @data[:contract].strike,
           @data[:contract].right
          ]
  queue.push(@data[:contract].multiplier) if server[:version] >= 15

  queue.concat([
                @data[:contract].exchange,
                @data[:contract].currency,
                @data[:contract].local_symbol,
               ])

  queue
end