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

#as_table, #content_attributes, #invariant_attributes, #set_attribute_defaults, #table_header, #table_row, #to_human, #update_missing

Instance Method Details

#==(other) ⇒ Object

Comparison



28
29
30
31
32
# File 'lib/models/ib/underlying.rb', line 28

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

#default_attributesObject



18
19
20
# File 'lib/models/ib/underlying.rb', line 18

def default_attributes
  super.merge :con_id => 0
end

#serializeObject

Serialize under_comp parameters



23
24
25
# File 'lib/models/ib/underlying.rb', line 23

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