| 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 274
274: def aliases
275: plugin_host.load_plugin_map
276: plugin_host.plugin_hash.inject [] do |aliases, (key, _)|
277: aliases << key if plugin_host[key] == self
278: aliases
279: end
280: end
The PluginHost for this Plugin class.
# File lib/coderay/helpers/plugin.rb, line 267
267: def plugin_host host = nil
268: if host.is_a? PluginHost
269: const_set :PLUGIN_HOST, host
270: end
271: self::PLUGIN_HOST
272: 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 251
251: def register_for id
252: @plugin_id = id
253: plugin_host.register self, id
254: end