Class: Ledger::Sdk::Models::Base::Instance Abstract
- Inherits:
-
Object
- Object
- Ledger::Sdk::Models::Base::Instance
- Defined in:
- lib/ledger/sdk/models/base.rb
Overview
Subclass and implement #uri
Abstract class representing an individual resource instance.
Handles lazy loading of data and associations to other resource types via the Instance.association class method.
Direct Known Subclasses
Account::Instance, Ledger::Sdk::Models::Balance::Instance, Container::Instance, Fee::Instance, FeeExclusion::Instance, FeeKind::Instance, Inventory::Instance, Movement::Instance, Position::Instance
Class Method Summary collapse
-
.association(name) ⇒ void
Declares an association to another resource type.
Instance Method Summary collapse
-
#data ⇒ Hash
Returns the resource data, loading it from the API if needed (lazy loading).
-
#initialize(id, data: nil, **extra) ⇒ Instance
constructor
Initializes a resource instance.
Constructor Details
#initialize(id, data: nil, **extra) ⇒ Instance
Initializes a resource instance.
Class Method Details
.association(name) ⇒ void
This method returns an undefined value.
Declares an association to another resource type.
Dynamically defines an instance method that allows navigating to an associated collection or a specific instance.
Instance Method Details
#data ⇒ Hash
Returns the resource data, loading it from the API if needed (lazy loading).