Class: IB::Datatypes::ComboLeg
- Inherits:
-
AbstractDatum
- Object
- AbstractDatum
- IB::Datatypes::ComboLeg
- Defined in:
- lib/ib-ruby/datatypes.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#con_id ⇒ Object
Returns the value of attribute con_id.
-
#exchange ⇒ Object
Returns the value of attribute exchange.
-
#open_close ⇒ Object
Returns the value of attribute open_close.
-
#ratio ⇒ Object
Returns the value of attribute ratio.
Instance Method Summary collapse
- #init ⇒ Object
-
#serialize(include_open_close = false) ⇒ Object
Some messages include open_close, some don’t.
Methods inherited from AbstractDatum
Constructor Details
This class inherits a constructor from IB::Datatypes::AbstractDatum
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
355 356 357 |
# File 'lib/ib-ruby/datatypes.rb', line 355 def action @action end |
#con_id ⇒ Object
Returns the value of attribute con_id.
355 356 357 |
# File 'lib/ib-ruby/datatypes.rb', line 355 def con_id @con_id end |
#exchange ⇒ Object
Returns the value of attribute exchange.
355 356 357 |
# File 'lib/ib-ruby/datatypes.rb', line 355 def exchange @exchange end |
#open_close ⇒ Object
Returns the value of attribute open_close.
355 356 357 |
# File 'lib/ib-ruby/datatypes.rb', line 355 def open_close @open_close end |
#ratio ⇒ Object
Returns the value of attribute ratio.
355 356 357 |
# File 'lib/ib-ruby/datatypes.rb', line 355 def ratio @ratio end |
Instance Method Details
#init ⇒ Object
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 |