Class: IB::Underlying

Inherits:
Model show all
Includes:
BaseProperties
Defined in:
lib/models/ib/underlying.rb

Overview

Calculated characteristics of underlying Contract (volatile)

Instance Method Summary collapse

Methods included from BaseProperties

#content_attributes, #set_attribute_defaults, #to_human, #update_missing

Instance Method Details

#==(other) ⇒ Object

Comparison



25
26
27
28
29
# File 'lib/models/ib/underlying.rb', line 25

def == other
  super(other) ||
    other.is_a?(self.class) &&
    con_id == other.con_id && delta == other.delta && price == other.price
end

#default_attributesObject



15
16
17
# File 'lib/models/ib/underlying.rb', line 15

def default_attributes
  super.merge :con_id => 0
end

#serializeObject

Serialize under_comp parameters



20
21
22
# File 'lib/models/ib/underlying.rb', line 20

def serialize
  [true, con_id, delta, price]
end