Class: Hookie::BasePlugin
- Inherits:
-
Object
- Object
- Hookie::BasePlugin
show all
- Defined in:
- lib/hookie/plugins/base_plugin.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(framework) ⇒ BasePlugin
Returns a new instance of BasePlugin.
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/hookie/plugins/base_plugin.rb', line 6
def initialize(framework)
@framework = framework
@config = {}
@framework.config.keys.each do |k|
if k.start_with?("hookie.#{self.config_key}")
@config[k.split(".")[2..-1].join("_").to_sym] = @framework.config[k]
end
end
end
|
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4
5
6
|
# File 'lib/hookie/plugins/base_plugin.rb', line 4
def config
@config
end
|
Instance Method Details
#config_key ⇒ Object
30
31
32
|
# File 'lib/hookie/plugins/base_plugin.rb', line 30
def config_key
plugin_name.downcase
end
|
#log(message) ⇒ Object
18
19
20
|
# File 'lib/hookie/plugins/base_plugin.rb', line 18
def log(message)
@framework.log(self, message)
end
|
#should_run? ⇒ Boolean
22
23
24
|
# File 'lib/hookie/plugins/base_plugin.rb', line 22
def should_run?
true
end
|
#to_s ⇒ Object
26
27
28
|
# File 'lib/hookie/plugins/base_plugin.rb', line 26
def to_s
plugin_name
end
|