Class: Mosaic::Sdk::Models::Dna

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

Overview

Represents the collection of DNAs (funds) from the Mosaic API.

Allows listing DNAs via the /v2/dnas endpoint. Each DNA can have multiple clones accessible through the association defined on Instance.

Examples:

List all DNAs

dnas = Mosaic::Sdk.Dna.list

Search for DNAs by name

dnas = Mosaic::Sdk.Dna.list('My Fund')

Filter DNAs by type

dnas = Mosaic::Sdk.Dna.list(type: 'etf')

Search and filter by type

dnas = Mosaic::Sdk.Dna.list('My Fund', type: 'equity')

Access clones for a DNA

dna = Mosaic::Sdk.Dna(42)
dna.clones.list      # => all clones for the DNA
dna.clones(7).data   # => data for clone 7

Defined Under Namespace

Classes: Instance

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#createvoid

This method returns an undefined value.

DNA creation is not supported by the Mosaic API.

Raises:

  • (NotImplementedError)

    DNA creation is not supported

#list(query = nil, type: nil) ⇒ Array<Instance>

Lists DNAs, optionally filtered by a search query and/or type.

Parameters:

  • query (String, nil) (defaults to: nil)

    an optional search string to filter by name

  • type (String, nil) (defaults to: nil)

    an optional kind to filter results (e.g. 'etf', 'equity', 'fund', 'bond')

Returns:

  • (Array<Instance>)

    array of DNA instances