Module: Ledger::Sdk
- Extended by:
- Configuration
- Defined in:
- lib/ledger/sdk.rb,
lib/ledger/sdk/client.rb,
lib/ledger/sdk/version.rb,
lib/ledger/sdk/models/fee.rb,
lib/ledger/sdk/models/base.rb,
lib/ledger/sdk/configuration.rb,
lib/ledger/sdk/models/import.rb,
lib/ledger/sdk/models/account.rb,
lib/ledger/sdk/models/balance.rb,
lib/ledger/sdk/models/fee_kind.rb,
lib/ledger/sdk/models/movement.rb,
lib/ledger/sdk/models/position.rb,
lib/ledger/sdk/models/container.rb,
lib/ledger/sdk/models/inventory.rb,
lib/ledger/sdk/models/import_line.rb,
lib/ledger/sdk/models/fee_exclusion.rb
Overview
Main module of the Ledger SDK.
Provides factory methods to access API resources (containers and their nested accounts, positions, inventories, balances, fees and fee exclusions, plus the fee-kind registry and imports) and configuration management via Configuration.
The SDK is mostly read-only: resources are browsed with list and
data, chaining associations from container down to inventory. The
write surface is narrow and explicit: containers (+Container#create+
and Container::Instance#update), their fees/fee-exclusions
(+create+/+update+/+destroy+ via Container::Instance#fees and
#fee_exclusions), and imports (+Import#create+, plus replaying an
import or one of its lines) can be managed; everything else,
including the fee-kind registry, stays read-only.
Imports are the only way to write positions and movements: Ledger
exposes both read-only over REST, so producers push lines through
Import#create, which also creates the container and accounts those
lines name.
Defined Under Namespace
Modules: Configuration, Models Classes: Client
Constant Summary collapse
- VERSION =
'0.9.0'
Class Method Summary collapse
-
.Container(id = nil) ⇒ Models::Container, Models::Container::Instance
Returns a container collection or a specific container instance.
-
.FeeKind(id = nil) ⇒ Models::FeeKind, Models::FeeKind::Instance
Returns a fee-kind collection or a specific fee-kind instance.
-
.Import(id = nil) ⇒ Models::Import, Models::Import::Instance
Returns an import collection or a specific import instance.
-
.Movement(id = nil) ⇒ Models::Movement, Models::Movement::Instance
Returns a movement collection or a specific movement instance.
-
.Position(id = nil) ⇒ Models::Position, Models::Position::Instance
Returns a root-level position collection or a specific position instance.
Methods included from Configuration
Class Method Details
.Container(id = nil) ⇒ Models::Container, Models::Container::Instance
Returns a container collection or a specific container instance.
.FeeKind(id = nil) ⇒ Models::FeeKind, Models::FeeKind::Instance
Returns a fee-kind collection or a specific fee-kind instance.
Fee kinds have no show endpoint: an instance built with an id
only exposes data if it was pre-loaded via Ledger::Sdk::Models::Base#list.
.Import(id = nil) ⇒ Models::Import, Models::Import::Instance
Returns an import collection or a specific import instance.
The collection is where lines are written: Import.create is the SDK's
only way to push positions and movements to the Ledger.
.Movement(id = nil) ⇒ Models::Movement, Models::Movement::Instance
Returns a movement collection or a specific movement instance.
.Position(id = nil) ⇒ Models::Position, Models::Position::Instance
Returns a root-level position collection or a specific position instance.
Positions have no show endpoint: an instance built with an id only
exposes data if it was pre-loaded via Ledger::Sdk::Models::Base#list. The root
collection requires a filters[code] security-code filter — without it
the Ledger API returns an empty array. A bare root instance (built via
this factory) has no container/account context, so calling
.inventories on it raises NotImplementedError: nested usage
(account- or container-scoped positions, and their inventories) still
goes through Ledger::Sdk::Models::Container::Instance#positions and
Ledger::Sdk::Models::Account::Instance#positions.