Class Autumn::Foliater
In: lib/autumn/foliater.rb
Parent: Object

Loads Stems and Leaves and executes them in their own threads. Manages the threads and oversees all leaves. This is a singleton class.

Methods

alive?   each_leaf   each_stem   hot_reload   load  

Included Modules

Singleton

Attributes

config  [R]  The Speciator singleton.
leaves  [R]  A hash of all Leaf instances by their config names.
stems  [R]  A hash of all Stem instances by their config names.

Public Instance methods

Returns true if there is at least one stem still running.

This method yields each Leaf subclass that was loaded, allowing you to iterate over each leaf. For instance, to take attendance:

 Foliater.instance.each_leaf { |leaf| leaf.stems.message "Here!" }

This method yields each Stem that was loaded, allowing you to iterate over each stem. For instance, to take attendance:

 Foliater.instance.each_stem { |stem| stem.message "Here!" }

Reloads a leaf while it is running. Re-opens class definition files and runs them to redefine the classes. Does not work exactly as it should, but well enough for a rough hot-reload capability.

Loads the config files and their classes, initializes all stems and leaves and begins the stems’ execution processes in their own threads. You must pass the stem and leaf config hashes (from the stems.yml and leaves.yml files).

If invoke is set to false, start_stems will not be called.

[Validate]