Class: Super::Pluggable
- Inherits:
-
Module
- Object
- Module
- Super::Pluggable
- Defined in:
- lib/super/plugin.rb
Instance Method Summary collapse
- #included(base) ⇒ Object
-
#initialize(registry_name) ⇒ Pluggable
constructor
A new instance of Pluggable.
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 |