Class: IB::AccountValue

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

Overview

Instantiate with a Hash of attributes, to be auto-set via initialize in Model.

Instance Method Summary collapse

Methods included from BaseProperties

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

Instance Method Details

#==(other) ⇒ Object

comparison



14
15
16
17
18
19
20
# File 'lib/models/ib/account_value.rb', line 14

def == other
  super(other) ||
    other.is_a?(self.class) &&
    key == other.key &&
    currency == other.currency &&
    value == other.value 
end

#default_attributesObject



21
22
23
24
25
# File 'lib/models/ib/account_value.rb', line 21

def default_attributes
  super.merge key: 'AccountValue',
	value: 0,
	currency: 'USD'
end

#to_humanObject Also known as: to_s



27
28
29
# File 'lib/models/ib/account_value.rb', line 27

def to_human
   "<#{key}=#{value} #{currency}>"
end