Class: Duty::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/duty/registry.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#pluginsObject (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_tasksObject



12
13
14
# File 'lib/duty/registry.rb', line 12

def load_tasks
  plugins.each {|plugin| plugin.load_tasks }
end