Class: Mosaic::Sdk::Models::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/mosaic/sdk/models/base.rb

Overview

This class is abstract.

Subclass and implement #uri

Abstract base class for all Mosaic API models.

Provides common collection operations: listing and creating resources. Subclasses must implement the private #uri method to define the API endpoint.

Direct Known Subclasses

Bank, Clone, Dna, Nav

Defined Under Namespace

Classes: Instance

Instance Method Summary collapse

Constructor Details

#initialize(extra = {}) ⇒ Base

Initializes a resource collection.

Parameters:

  • extra (Hash) (defaults to: {})

    additional context (e.g. parent IDs for nested resources)

Instance Method Details

#create(**kwargs) ⇒ Instance

Creates a new resource.

Parameters:

  • kwargs (Hash)

    the attributes of the resource to create

Returns:

  • (Instance)

    the created resource instance

#listArray<Instance>

Lists all resources of this type.

Returns:

  • (Array<Instance>)

    array of resource instances