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_CLASSES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

All classes (plugins) under the Muzak::Player namespace.

constants.map(&Plugin.method(:const_get)).grep(Class).freeze
PLUGIN_NAMES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

All human-friendly player plugin names.

PLUGIN_CLASSES.map(&:plugin_name).freeze
PLUGIN_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

An association of human-friendly plugin names to plugin classes.

PLUGIN_NAMES.zip(PLUGIN_CLASSES).to_h.freeze

Class Method Summary collapse

Class Method Details

.load_plugins!Array<StubPlugin>

Instantiates all configured plugins and returns them.

Returns:

  • (Array<StubPlugin>)

    the instantiated plugins


30
31
32
33
34
35
36
# File 'lib/muzak/plugin.rb', line 30

def self.load_plugins!
  pks = PLUGIN_CLASSES.select do |pk|
    Config.plugin?(pk.plugin_name) && pk.available?
  end

  pks.map(&:new)
end