Sha256: bd2c0fba88c43e6cb6a8f5d53d6f16567fb5db2e013c778ae41189cdb68ff23b

Contents?: true

Size: 350 Bytes

Versions: 2

Compression:

Stored size: 350 Bytes

Contents

module IB
  class  Contract
    def included_in? account
      self if   account.locate_contract(con_id)
    end

    def portfolio_value account
      if con_id.to_i > 0
        account.portfolio_values.detect{|x| x.contract.con_id == con_id }
      else
        account.portfolio_values.detect{|x| x.contract == self }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ib-extensions-1.3.1 lib/ib/models/contract.rb
ib-extensions-1.3 lib/ib/models/contract.rb