Class: IB::Messages::Incoming::ContractData

Inherits:
Object
  • Object
show all
Defined in:
lib/ib/messages/incoming/contract_data.rb

Instance Method Summary collapse

Instance Method Details

#contractObject



45
46
47
48
# File 'lib/ib/messages/incoming/contract_data.rb', line 45

def contract
  @contract = IB::Contract.build @data[:contract].
    merge(:contract_detail => contract_detail)
end

#contract_detailObject Also known as: contract_details



50
51
52
# File 'lib/ib/messages/incoming/contract_data.rb', line 50

def contract_detail
  @contract_detail = IB::ContractDetail.new @data[:contract_detail]
end

#loadObject



56
57
58
59
60
61
62
63
# File 'lib/ib/messages/incoming/contract_data.rb', line 56

def load
  super

  @data[:contract_detail][:sec_id_list] ||= HashWithIndifferentAccess.new
  @data[:sec_id_list_count].times do
    @data[:contract_detail][:sec_id_list][socket.read_string] = socket.read_string
  end
end