Class Autumn::Speciator
In: lib/autumn/speciator.rb
Parent: Object

The Speciator stores the global, season, stem, and leaf configurations. It generates composite hashes, so that any leaf or stem can know its specific configuration as a combination of its options and those of the scopes above it.

Smaller scopes override larger ones; any season-specific options will replace global options, and leaf or stem options will overwrite season options. Leaf and stem options are independent from each other, however, since leaves and stems share a many-to-many relationship.

Option identifiers can be specified as strings or symbols but are always stored as symbols and never accessed as strings.

This is a singleton class; only one instance of it exists for any Autumn process. However, for the sake of convenience, many other objects use a config attribute containing the instance.

Methods

Included Modules

Singleton

Public Class methods

Creates a new instance storing no options.

Public Instance methods

Returns the global-scope or season-scope config option with the given symbol. Season-scope config options will override global ones.

Returns an array of all leaf class names in use.

Yields each leaf identifier and its options.

Yields each stem identifier and its options.

When called with a hash: Takes a hash of options and values, and sets them at the global scope level.

When called with an option identifier: Returns the value for that option at the global scope level.

When called with a hash: Takes a hash of options and values, and sets them at the leaf scope level.

When called with an option identifier: Returns the value for that option exclusively at the leaf scope level.

The identifier for the leaf must be specified.

Returns true if the given identifier is a known leaf identifier.

Returns the composite options for a leaf (by identifier), as an amalgamation of all the scope levels’ options.

Returns the composite options for a stem (by identifier), as an amalgamation of all the scope levels’ options.

When called with a hash: Takes a hash of options and values, and sets them at the season scope level.

When called with an option identifier: Returns the value for that option exclusively at the season scope level.

Since Autumn can only be run in one season per process, there is no need to store the options of specific seasons, only the current season.

When called with a hash: Takes a hash of options and values, and sets them at the stem scope level.

When called with an option identifier: Returns the value for that option exclusively at the stem scope level.

The identifier for the stem must be specified.

Returns true if the given identifier is a known stem identifier.

[Validate]