Module | Webgen::PluginDefs |
In: |
lib/webgen/plugin.rb
|
Base module for all plugins. This module should be included by classes which need to derive from an existing class but also need the power of the plugin system. If a class does not have any base class, it is better to derive it from Webgen::Plugin instead of including this module.
CALLER_REGEXP | = | Regexp.new("`.*'") |
Appends the methods of this module as object methods to the including class and the methods defined in the module ClassMethods as class methods.
# File lib/webgen/plugin.rb, line 121 121: def self.append_features( klass ) 122: super 123: klass.extend( ClassMethods ) 124: end
Assigns the PluginManager used for the plugin instance.
# File lib/webgen/plugin.rb, line 127 127: def initialize( plugin_manager ) 128: @plugin_manager = plugin_manager 129: end
Returns the parameter name for the plugin. If plugin is specified, the parameter name for the plugin plugin is returned.
# File lib/webgen/plugin.rb, line 133 133: def []( name, plugin = nil) 134: @plugin_manager.param_for_plugin( plugin || self.class.plugin_name, name ) 135: end