Class: IB::Messages::Incoming::ScannerData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



20
21
22
# File 'lib/ib/messages/incoming/scanner_data.rb', line 20

def results
  @results
end

Instance Method Details

#loadObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/ib/messages/incoming/scanner_data.rb', line 22

def load
  super

  @results = Array.new(@data[:count]) do |_|
    {:rank => socket.read_int,
     :contract =>
         Contract.build(
             :con_id => socket.read_int,
             :symbol => socket.read_str,
             :sec_type => socket.read_str,
             :expiry => socket.read_str,
             :strike => socket.read_decimal,
             :right => socket.read_str,
             :exchange => socket.read_str,
             :currency => socket.read_str,
             :local_symbol => socket.read_str,
             :contract_detail =>
                 IB::ContractDetail.new(
                     :market_name => socket.read_str,
                     :trading_class => socket.read_str)),
     :distance => socket.read_str,
     :benchmark => socket.read_str,
     :projection => socket.read_str,
     :legs => socket.read_str,
    }
  end
end