Class: IB::IncomingMessages::ContractData

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

Instance Attribute Summary collapse

Attributes inherited from AbstractMessage

#data

Attributes inherited from ExtremelyAbstractMessage

#created_at

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractMessage

inherited, #initialize

Methods inherited from ExtremelyAbstractMessage

#to_human

Constructor Details

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

Instance Attribute Details

#contract_detailsObject

Returns the value of attribute contract_details.



1212
1213
1214
# File 'lib/ib-ruby/messages.rb', line 1212

def contract_details
  @contract_details
end

Class Method Details

.message_idObject



1214
1215
1216
# File 'lib/ib-ruby/messages.rb', line 1214

def self.message_id
  10
end

Instance Method Details

#loadObject



1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
# File 'lib/ib-ruby/messages.rb', line 1218

def load
  @contract_details = Datatypes::ContractDetails.new

  autoload([:version, :int])

  @contract_details.summary.symbol = @socket.read_string
  @contract_details.summary.sec_type = @socket.read_string
  @contract_details.summary.expiry = @socket.read_string
  @contract_details.summary.strike = @socket.read_decimal
  @contract_details.summary.right = @socket.read_string
  @contract_details.summary.exchange = @socket.read_string
  @contract_details.summary.currency = @socket.read_string
  @contract_details.summary.local_symbol = @socket.read_string

  @contract_details.market_name = @socket.read_string
  @contract_details.trading_class = @socket.read_string
  @contract_details.con_id = @socket.read_int
  @contract_details.min_tick = @socket.read_decimal
  @contract_details.multiplier = @socket.read_string
  @contract_details.order_types = @socket.read_string
  @contract_details.valid_exchanges = @socket.read_string
  @contract_details.price_magnifier = @socket.read_int if @data[:version] >= 2

end