Class: ROM::PluginRegistryBase Private
- Defined in:
- lib/rom/plugin_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.
Abstract registry defining common behaviour
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Registry
Instance Method Summary collapse
-
#[](name) ⇒ Plugin
Retrieve a registered plugin.
-
#plugin_name(plugin) ⇒ Symbol
private
Returns plugin name by instance.
-
#register(name, mod, options) ⇒ Object
private
Assign a plugin to this environment registry.
Methods inherited from Registry
#each, element_not_found_error, #fetch, #key?, #map, new, #respond_to_missing?
Methods included from Initializer
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ROM::Registry
Instance Method Details
#[](name) ⇒ Plugin
Retrieve a registered plugin
101 102 103 |
# File 'lib/rom/plugin_registry.rb', line 101 def [](name) elements[name] end |
#plugin_name(plugin) ⇒ Symbol
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.
Returns plugin name by instance
121 122 123 124 |
# File 'lib/rom/plugin_registry.rb', line 121 def plugin_name(plugin) tuple = elements.find { |(_, p)| p.equal?(plugin) } tuple[0] if tuple end |
#register(name, mod, options) ⇒ Object
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.
Assign a plugin to this environment registry
112 113 114 |
# File 'lib/rom/plugin_registry.rb', line 112 def register(name, mod, ) elements[name] = plugin_type.new(mod, ) end |