Class: Duty::Registry
- Inherits:
-
Object
- Object
- Duty::Registry
- Defined in:
- lib/duty/registry.rb
Instance Attribute Summary collapse
-
#plugins ⇒ Object
readonly
Returns the value of attribute plugins.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(plugins) ⇒ Registry
constructor
A new instance of Registry.
- #load_tasks ⇒ Object
Constructor Details
#initialize(plugins) ⇒ Registry
Returns a new instance of Registry.
8 9 10 |
# File 'lib/duty/registry.rb', line 8 def initialize(plugins) @plugins = plugins end |
Instance Attribute Details
#plugins ⇒ Object (readonly)
Returns the value of attribute plugins.
7 8 9 |
# File 'lib/duty/registry.rb', line 7 def plugins @plugins end |
Class Method Details
.register(plugins = []) ⇒ Object
3 4 5 |
# File 'lib/duty/registry.rb', line 3 def self.register(plugins = []) new(plugins).tap {|registry| registry.load_tasks } end |
Instance Method Details
#load_tasks ⇒ Object
12 13 14 |
# File 'lib/duty/registry.rb', line 12 def load_tasks plugins.each {|plugin| plugin.load_tasks } end |