Class: Ledger::Sdk::Models::Inventory

Inherits:
Base
  • Object
show all
Defined in:
lib/ledger/sdk/models/inventory.rb

Overview

Represents the collection of inventories (quantity and cost snapshots) from the Ledger API.

Inventories are always accessed in the context of a position via /containers/:container_id/accounts/:account_id/positions/:position_id/inventories. The Ledger API exposes no individual inventory endpoint: inventory data is only available through Base#list.

Examples:

List inventories for a position

inventories = Ledger::Sdk.Container(42).accounts(7).positions(3).inventories.list
inventories.first.data # => { 'id' => 4, 'quantity' => 10.0, ... }

Defined Under Namespace

Classes: Instance

Method Summary

Methods inherited from Base

#initialize, #list

Constructor Details

This class inherits a constructor from Ledger::Sdk::Models::Base