Class: Duty::Plugins::Plugin

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

Instance Method Summary collapse

Constructor Details

#initialize(namespace, entry) ⇒ Plugin

Returns a new instance of Plugin.



25
26
27
28
29
# File 'lib/duty/plugins.rb', line 25

def initialize(namespace, entry)
  @namespace = namespace
  @entry = entry
  @tasks = []
end

Instance Method Details

#load_tasksObject



41
42
43
44
# File 'lib/duty/plugins.rb', line 41

def load_tasks
  require_tasks
  expose_tasks
end

#namespaceObject



31
32
33
# File 'lib/duty/plugins.rb', line 31

def namespace
  @namespace
end

#tasksObject



35
36
37
38
39
# File 'lib/duty/plugins.rb', line 35

def tasks
  @task_classes.select do |task_class|
    valid?(task_class)
  end
end