Class: Super::Pluggable

Inherits:
Module
  • Object
show all
Defined in:
lib/super/plugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(registry_name) ⇒ Pluggable

Returns a new instance of Pluggable.



3
4
5
# File 'lib/super/plugin.rb', line 3

def initialize(registry_name)
  @registry_name = registry_name
end

Instance Method Details

#included(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/super/plugin.rb', line 7

def included(base)
  super

  PluginRegistry.base_set(@registry_name, base)

  plugins = PluginRegistry.plugins_for(@registry_name)

  plugins.each do |klass, method_name|
    base.public_send(method_name, klass)
  end
end