Sha256: 1e2c0d9eb7acb15103627226c09bb95a235d7719d4ccb553646d1b5f413edc87

Contents?: true

Size: 641 Bytes

Versions: 9

Compression:

Stored size: 641 Bytes

Contents

module IB
  # Instantiate with a Hash of attributes, to be auto-set via initialize in Model.
  class AccountValue < IB::Model
    include BaseProperties

    belongs_to :account 

    prop  :key,
	  :value,
	  :currency


    #  comparison
    def == other
      super(other) ||
        other.is_a?(self.class) &&
        key == other.key &&
        currency == other.currency &&
        value == other.value 
    end
    def default_attributes
      super.merge key: 'AccountValue',
	value: 0,
	currency: 'USD'
    end

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

    alias to_s to_human
  end # class 
end # module IB

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ib-api-972.5.2 lib/models/ib/account_value.rb
ib-api-972.5.1 lib/models/ib/account_value.rb
ib-api-972.5 lib/models/ib/account_value.rb
ib-api-972.4 lib/models/ib/account_value.rb
ib-api-972.3.1 lib/models/ib/account_value.rb
ib-api-972.3 lib/models/ib/account_value.rb
ib-api-972.2 lib/models/ib/account_value.rb
ib-api-972.1 lib/models/ib/account_value.rb
ib-api-972.0 lib/models/ib/account_value.rb