Class: Ledger::Sdk::Models::Account::Instance
- Inherits:
-
Base::Instance
- Object
- Base::Instance
- Ledger::Sdk::Models::Account::Instance
- Defined in:
- lib/ledger/sdk/models/account.rb
Overview
Represents an individual account instance.
Has an association to Position allowing navigation to the positions attached to this account.
Instance Method Summary collapse
-
#balances(name) ⇒ Balance
Access the balances of this account for a given balance name.
-
#performance(from: nil, to: nil, method: nil, name: nil, income: nil, granularity: nil) ⇒ Hash
This account's performance over a window: its own composed return and each of its lines' contribution to it, decomposed into what the price and the currency each drove.
-
#positions(associated_id = nil) ⇒ Position, Position::Instance
Access the positions associated with this account.
Methods inherited from Base::Instance
association, #data, #initialize
Constructor Details
This class inherits a constructor from Ledger::Sdk::Models::Base::Instance
Instance Method Details
#balances(name) ⇒ Balance
Access the balances of this account for a given balance name.
#performance(from: nil, to: nil, method: nil, name: nil, income: nil, granularity: nil) ⇒ Hash
This account's performance over a window: its own composed return and each of its lines' contribution to it, decomposed into what the price and the currency each drove. Read-only.
Contributions are shares of THIS account's return, not the portfolio's —
the same line read from the container answers a different figure.
contribution_series, when present, likewise describes only this account.
contribution is null — the key is there, its value is not — whenever there is
nothing to decompose: a cash line, or a window ledger cannot chain. Null says
"no answer"; a zero would have claimed the lines produced nothing.
Ledger defaults to to the account's latest revalued balance date and from
to thirty days before it. An unreadable date, an unknown method, name or
granularity falls back to the default rather than failing.
#positions(associated_id = nil) ⇒ Position, Position::Instance
Access the positions associated with this account.