Class: Mosaic::Sdk::Models::Base::Instance Abstract
- Inherits:
-
Object
- Object
- Mosaic::Sdk::Models::Base::Instance
- Defined in:
- lib/mosaic/sdk/models/base.rb
Overview
This class is abstract.
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
Mosaic::Sdk::Models::Bank::Instance, Clone::Instance, Dna::Instance, Nav::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).