Class: Ledger::Sdk::Models::Container::Instance
- Inherits:
-
Base::Instance
- Object
- Base::Instance
- Ledger::Sdk::Models::Container::Instance
- Defined in:
- lib/ledger/sdk/models/container.rb
Overview
Represents an individual container instance.
Has associations to Account, Position, Fee and FeeExclusion allowing navigation to the accounts, positions, fees and fee exclusions attached to this container.
Instance Method Summary collapse
-
#accounts(associated_id = nil) ⇒ Account, Account::Instance
Access the accounts associated with this container.
-
#balances(name) ⇒ Balance
Access the balances of this container for a given balance name.
-
#charge_breakdown(as_of: nil, from: nil) ⇒ Hash
Per-label ventilation of this container's charges, embedded by the container show when requested (+with_component_breakdown+): totals, monthly buckets and the underlying component lines.
-
#fee_exclusions(associated_id = nil) ⇒ FeeExclusion, FeeExclusion::Instance
Access the fee-base exclusions attached to this container.
-
#fees(associated_id = nil) ⇒ Fee, Fee::Instance
Access the fees attached to this container.
-
#performance(from: nil, to: nil, method: nil, name: nil, income: nil, granularity: nil) ⇒ Hash
This container's performance over a window: the composed return of the portfolio, of each of its accounts and of each line, plus what the price and the currency each drove (+contribution+).
-
#positions ⇒ Position
Access every position of this container in one call (each account's displayable positions), via
/containers/<id>/positions. -
#update(attributes) ⇒ Hash
Updates this container's attributes.
Methods inherited from Base::Instance
association, #data, #initialize
Constructor Details
This class inherits a constructor from Ledger::Sdk::Models::Base::Instance
Instance Method Details
#accounts(associated_id = nil) ⇒ Account, Account::Instance
Access the accounts associated with this container.
#balances(name) ⇒ Balance
Access the balances of this container for a given balance name.
#charge_breakdown(as_of: nil, from: nil) ⇒ Hash
Per-label ventilation of this container's charges, embedded by the
container show when requested (+with_component_breakdown+): totals,
monthly buckets and the underlying component lines. The window is
read as of an instant: as_of is the upper bound (ledger defaults
to today), from the optional lower bound (inception when nil).
Read-only.
#fee_exclusions(associated_id = nil) ⇒ FeeExclusion, FeeExclusion::Instance
Access the fee-base exclusions attached to this container.
#fees(associated_id = nil) ⇒ Fee, Fee::Instance
Access the fees attached to this container.
#performance(from: nil, to: nil, method: nil, name: nil, income: nil, granularity: nil) ⇒ Hash
This container's performance over a window: the composed return of the portfolio, of each of its accounts and of each line, plus what the price and the currency each drove (+contribution+). Read-only.
Unlike #charge_breakdown the whole document is the answer, not a field of a show — this is its own endpoint.
contribution is always relative to the subject queried: a line's contribution
here is its share of the portfolio's return, not of its own account's — read the
same line from Account::Instance#performance for that. contribution_series,
when present, likewise describes only this container, never the nested accounts.
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 (a day that
lost everything leaves no growth factor to take a log of, as an onboarding
mandate does when it banks its cash before its holdings are priced). Null says
"no answer"; a zero would have claimed the lines produced nothing.
Ledger defaults to to the container'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 ⇒ Position
Access every position of this container in one call (each account's
displayable positions), via /containers/<id>/positions.
#update(attributes) ⇒ Hash
Updates this container's attributes. Alongside fees and fee-exclusions management, this is one of the SDK's few write operations — most of the SDK remains read-only. Used by folio to persist the container's asset manager (+manager_id+, a mosaic bank id). Updates this container's attributes. This is the SDK's ONE write operation — everything else is read-only. Used by folio to persist the container's asset manager (+manager_id+, a mosaic bank id).