Module | CodeRay::Plugin |
In: |
lib/coderay/helpers/plugin.rb
|
Plugins have to include this module. IMPORTANT: Use extend for this module. See CodeRay::PluginHost for examples.
plugin_id | [R] |
# File lib/coderay/helpers/plugin.rb, line 273 273: def aliases 274: plugin_host.load_plugin_map 275: plugin_host.plugin_hash.inject [] do |aliases, (key, _)| 276: aliases << key if plugin_host[key] == self 277: aliases 278: end 279: end
The PluginHost for this Plugin class.
# File lib/coderay/helpers/plugin.rb, line 266 266: def plugin_host host = nil 267: if host.is_a? PluginHost 268: const_set :PLUGIN_HOST, host 269: end 270: self::PLUGIN_HOST 271: end
Register this class for the given id.
Example:
class MyPlugin < PluginHost::BaseClass register_for :my_id ... end
See PluginHost.register.
# File lib/coderay/helpers/plugin.rb, line 250 250: def register_for id 251: @plugin_id = id 252: plugin_host.register self, id 253: end