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 collapse
-
#plugin_type ⇒ Class
readonly
Typically ROM::PluginBase or its descendant.
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, #merge, new, #respond_to_missing?, #to_hash
Methods included from Initializer
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ROM::Registry
Instance Attribute Details
#plugin_type ⇒ Class (readonly)
Returns Typically ROM::PluginBase or its descendant.
94 |
# File 'lib/rom/plugin_registry.rb', line 94 option :plugin_type |
Instance Method Details
#[](name) ⇒ Plugin
Retrieve a registered plugin
103 104 105 |
# File 'lib/rom/plugin_registry.rb', line 103 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
123 124 125 126 |
# File 'lib/rom/plugin_registry.rb', line 123 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
114 115 116 |
# File 'lib/rom/plugin_registry.rb', line 114 def register(name, mod, ) elements[name] = plugin_type.new(mod, ) end |