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.
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.