Class: SmartCore::Initializer::Plugins::Registry Private
- Inherits:
-
Object
- Object
- SmartCore::Initializer::Plugins::Registry
- Includes:
- Enumerable
- Defined in:
- lib/smart_core/initializer/plugins/registry.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #[](plugin_name) ⇒ SmartCore::Initializer::Plugins::Abstract private
- #each(&block) ⇒ Enumerable private
- #initialize ⇒ void constructor private
- #loaded ⇒ Hash<String,Class<SmartCore::Initializer::Plugins::Abstract>> private
- #names ⇒ Array<String> private
- #register(plugin_name, plugin_module) ⇒ void (also: #[]=) private
Constructor Details
#initialize ⇒ 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.
15 16 17 18 |
# File 'lib/smart_core/initializer/plugins/registry.rb', line 15 def initialize @plugin_set = {} @access_lock = SmartCore::Engine::ReadWriteLock.new end |
Instance Method Details
#[](plugin_name) ⇒ SmartCore::Initializer::Plugins::Abstract
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.
26 27 28 |
# File 'lib/smart_core/initializer/plugins/registry.rb', line 26 def [](plugin_name) @access_lock.read_sync { fetch(plugin_name) } end |
#each(&block) ⇒ Enumerable
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.
66 67 68 |
# File 'lib/smart_core/initializer/plugins/registry.rb', line 66 def each(&block) @access_lock.read_sync { iterate(&block) } end |
#loaded ⇒ Hash<String,Class<SmartCore::Initializer::Plugins::Abstract>>
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.
56 57 58 |
# File 'lib/smart_core/initializer/plugins/registry.rb', line 56 def loaded @access_lock.read_sync { loaded_plugins } end |
#names ⇒ Array<String>
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.
47 48 49 |
# File 'lib/smart_core/initializer/plugins/registry.rb', line 47 def names @access_lock.read_sync { plugin_names } end |
#register(plugin_name, plugin_module) ⇒ void Also known as: []=
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.
37 38 39 |
# File 'lib/smart_core/initializer/plugins/registry.rb', line 37 def register(plugin_name, plugin_module) @access_lock.write_sync { apply(plugin_name, plugin_module) } end |