Module: SmartCore::Initializer::Plugins::RegistryInterface Private
- Included in:
- SmartCore::Initializer::Plugins
- Defined in:
- lib/smart_core/initializer/plugins/registry_interface.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .extended(base_module) ⇒ void private
Instance Method Summary collapse
- #load(plugin_name) ⇒ void
- #loaded_plugins ⇒ Array<String>
- #names ⇒ Array<String>
- #register_plugin(plugin_name, plugin_module) ⇒ void private
Class Method Details
.extended(base_module) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
14 15 16 17 18 19 20 21 |
# File 'lib/smart_core/initializer/plugins/registry_interface.rb', line 14 def extended(base_module) base_module.instance_variable_set( :@plugin_registry, SmartCore::Initializer::Plugins::Registry.new ) base_module.instance_variable_set( :@access_lock, SmartCore::Engine::ReadWriteLock.new ) end |
Instance Method Details
#load(plugin_name) ⇒ void
This method returns an undefined value.
30 31 32 |
# File 'lib/smart_core/initializer/plugins/registry_interface.rb', line 30 def load(plugin_name) @access_lock.read_sync { plugin_registry[plugin_name].load! } end |
#loaded_plugins ⇒ Array<String>
39 40 41 |
# File 'lib/smart_core/initializer/plugins/registry_interface.rb', line 39 def loaded_plugins @access_lock.read_sync { plugin_registry.loaded.keys } end |
#names ⇒ Array<String>
48 49 50 |
# File 'lib/smart_core/initializer/plugins/registry_interface.rb', line 48 def names @access_lock.read_sync { plugin_registry.names } end |
#register_plugin(plugin_name, plugin_module) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
58 59 60 |
# File 'lib/smart_core/initializer/plugins/registry_interface.rb', line 58 def register_plugin(plugin_name, plugin_module) @access_lock.write_sync { plugin_registry[plugin_name] = plugin_module } end |