class YleTf::Plugin::Manager

Attributes

registered[R]

Public Class Methods

new() click to toggle source
# File lib/yle_tf/plugin/manager.rb, line 10
def initialize
  @registered = []
end

Public Instance Methods

action_hooks() click to toggle source
# File lib/yle_tf/plugin/manager.rb, line 21
def action_hooks
  registered.map(&:action_hooks).flatten
end
backends() click to toggle source
# File lib/yle_tf/plugin/manager.rb, line 42
def backends
  {}.tap do |backends|
    registered.each do |plugin|
      backends.merge!(plugin.backends)
    end
    backends.default = backends.delete(DEFAULT_BACKEND)
  end
end
commands() click to toggle source
# File lib/yle_tf/plugin/manager.rb, line 25
def commands
  {}.tap do |commands|
    registered.each do |plugin|
      commands.merge!(plugin.commands)
    end
    commands.default = commands.delete(DEFAULT_COMMAND)
  end
end
config_contexts() click to toggle source
# File lib/yle_tf/plugin/manager.rb, line 34
def config_contexts
  registered.map(&:config_context)
end
default_configs() click to toggle source
# File lib/yle_tf/plugin/manager.rb, line 38
def default_configs
  registered.map(&:default_config)
end
register(plugin) click to toggle source
# File lib/yle_tf/plugin/manager.rb, line 14
def register(plugin)
  if !registered.include?(plugin)
    Logger.debug("Registered plugin: #{plugin}")
    @registered << plugin
  end
end