Module: Virtuatable::Builders::Helpers::Loaders
- Included in:
- Base
- Defined in:
- lib/virtuatable/builders/helpers/loaders.rb
Overview
Add the methods to declare an array of loaders into a builder class.
Instance Attribute Summary collapse
-
#loaders ⇒ Array
An array of loading functions invoked at startup.
Instance Method Summary collapse
-
#declare_loader(loader, priority:) ⇒ Object
Declares a loader in the current builder class.
Instance Attribute Details
#loaders ⇒ Array
Returns an array of loading functions invoked at startup.
11 12 13 |
# File 'lib/virtuatable/builders/helpers/loaders.rb', line 11 def loaders @loaders end |
Instance Method Details
#declare_loader(loader, priority:) ⇒ Object
Declares a loader in the current builder class.
15 16 17 18 |
# File 'lib/virtuatable/builders/helpers/loaders.rb', line 15 def declare_loader(loader, priority:) loader_h = { name: loader.to_sym, priority: priority } @loaders.nil? ? @loaders = [loader_h] : @loaders << loader_h end |