Module: Muzak::Plugin
- Defined in:
- lib/muzak/plugin.rb,
lib/muzak/plugin/stub_plugin.rb
Overview
The namespace for muzak plugins.
Defined Under Namespace
Classes: StubPlugin
Constant Summary collapse
- PLUGIN_MAP =
An association of plugin names to their Class objects.
plugin_names.zip(plugin_classes).to_h.freeze
Class Method Summary collapse
-
.load_plugins! ⇒ Array<StubPlugin>
Instantiates all configured plugins and returns them.
-
.plugin_classes ⇒ Array<Class>
All plugin classes visible under Plugin.
-
.plugin_names ⇒ Array<String>
The names of all plugin classes under Plugin.
Class Method Details
.load_plugins! ⇒ Array<StubPlugin>
Instantiates all configured plugins and returns them.
28 29 30 31 |
# File 'lib/muzak/plugin.rb', line 28 def self.load_plugins! pks = Plugin.plugin_classes.select { |pk| Config.plugin? pk.plugin_name } pks.map { |pk| pk.new } end |
.plugin_classes ⇒ Array<Class>
Returns all plugin classes visible under Plugin.
14 15 16 |
# File 'lib/muzak/plugin.rb', line 14 def self.plugin_classes constants.map(&Plugin.method(:const_get)).grep(Class) end |
.plugin_names ⇒ Array<String>
Returns the names of all plugin classes under Plugin.
20 21 22 23 24 |
# File 'lib/muzak/plugin.rb', line 20 def self.plugin_names plugin_classes.map do |pk| pk.plugin_name end end |