Class: ROM::PluginRegistry Private
- Inherits:
-
Object
- Object
- ROM::PluginRegistry
- 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.
Stores all registered plugins
Instance Attribute Summary collapse
-
#commands ⇒ InternalPluginRegistry
readonly
private
Internal registry for command plugins.
-
#configuration ⇒ ConfigurationPluginRegistry
readonly
private
Internal registry for configuration plugins.
-
#mappers ⇒ InternalPluginRegistry
readonly
private
Internal registry for mapper plugins.
-
#relations ⇒ InternalPluginRegistry
readonly
private
Internal registry for relation plugins.
-
#schemas ⇒ InternalPluginRegistry
readonly
private
Internal registry for schema plugins.
Instance Method Summary collapse
-
#initialize ⇒ PluginRegistry
constructor
private
A new instance of PluginRegistry.
-
#register(name, mod, options = EMPTY_HASH) ⇒ Object
private
Register a plugin for future use.
Constructor Details
#initialize ⇒ PluginRegistry
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 a new instance of PluginRegistry.
44 45 46 47 48 49 50 |
# File 'lib/rom/plugin_registry.rb', line 44 def initialize @configuration = ConfigurationPluginRegistry.new @mappers = InternalPluginRegistry.new @commands = InternalPluginRegistry.new @relations = InternalPluginRegistry.new @schemas = InternalPluginRegistry.new(SchemaPlugin) end |
Instance Attribute Details
#commands ⇒ InternalPluginRegistry (readonly)
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.
Internal registry for command plugins
20 21 22 |
# File 'lib/rom/plugin_registry.rb', line 20 def commands @commands end |
#configuration ⇒ ConfigurationPluginRegistry (readonly)
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.
Internal registry for configuration plugins
13 14 15 |
# File 'lib/rom/plugin_registry.rb', line 13 def configuration @configuration end |
#mappers ⇒ InternalPluginRegistry (readonly)
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.
Internal registry for mapper plugins
27 28 29 |
# File 'lib/rom/plugin_registry.rb', line 27 def mappers @mappers end |
#relations ⇒ InternalPluginRegistry (readonly)
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.
Internal registry for relation plugins
34 35 36 |
# File 'lib/rom/plugin_registry.rb', line 34 def relations @relations end |
#schemas ⇒ InternalPluginRegistry (readonly)
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.
Internal registry for schema plugins
41 42 43 |
# File 'lib/rom/plugin_registry.rb', line 41 def schemas @schemas end |
Instance Method Details
#register(name, mod, options = EMPTY_HASH) ⇒ 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.
Register a plugin for future use
relation or mapper) applies to. Leave blank for all adapters
61 62 63 64 65 66 |
# File 'lib/rom/plugin_registry.rb', line 61 def register(name, mod, = EMPTY_HASH) type = .fetch(:type) adapter = .fetch(:adapter, :default) plugins_for(type, adapter).register(name, mod, ) end |