Class: IB::Datatypes::ComboLeg

Inherits:
AbstractDatum show all
Defined in:
lib/ib-ruby/datatypes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractDatum

#initialize

Constructor Details

This class inherits a constructor from IB::Datatypes::AbstractDatum

Instance Attribute Details

#actionObject

Returns the value of attribute action.



355
356
357
# File 'lib/ib-ruby/datatypes.rb', line 355

def action
  @action
end

#con_idObject

Returns the value of attribute con_id.



355
356
357
# File 'lib/ib-ruby/datatypes.rb', line 355

def con_id
  @con_id
end

#exchangeObject

Returns the value of attribute exchange.



355
356
357
# File 'lib/ib-ruby/datatypes.rb', line 355

def exchange
  @exchange
end

#open_closeObject

Returns the value of attribute open_close.



355
356
357
# File 'lib/ib-ruby/datatypes.rb', line 355

def open_close
  @open_close
end

#ratioObject

Returns the value of attribute ratio.



355
356
357
# File 'lib/ib-ruby/datatypes.rb', line 355

def ratio
  @ratio
end

Instance Method Details

#initObject



357
358
359
360
361
362
363
# File 'lib/ib-ruby/datatypes.rb', line 357

def init
  super

  @con_id = 0
  @ratio = 0
  @open_close = 0
end

#serialize(include_open_close = false) ⇒ Object

Some messages include open_close, some don’t. wtf.



366
367
368
369
370
# File 'lib/ib-ruby/datatypes.rb', line 366

def serialize(include_open_close = false)
  self.collect { |leg|
    [ leg.con_id, leg.ratio, leg.action, leg.exchange, (include_open_close ? leg.open_close : [] )]
  }.flatten
end