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



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
49
# File 'lib/ib/messages/incoming/scanner_data.rb', line 23

def load
  super

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