Module: ROM::Global
- Included in:
- ROM
- Defined in:
- lib/rom/global.rb,
lib/rom/global/plugin_dsl.rb
Overview
Globally accessible public interface exposed via ROM module
Defined Under Namespace
Classes: PluginDSL
Instance Attribute Summary collapse
-
#adapters ⇒ Hash<Symbol=>Module>
readonly
private
An internal adapter identifier => adapter module map used by setup.
-
#plugin_registry ⇒ Hash
readonly
private
An internal identifier => plugin map used by the setup.
Class Method Summary collapse
-
.extended(rom) ⇒ Object
private
Set base global registries in ROM constant.
Instance Method Summary collapse
-
#plugins(*args, &block) ⇒ Object
Global plugin setup DSL.
-
#register_adapter(identifier, adapter) ⇒ self
private
Register adapter namespace under a specified identifier.
Instance Attribute Details
#adapters ⇒ Hash<Symbol=>Module> (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.
An internal adapter identifier => adapter module map used by setup
24 25 26 |
# File 'lib/rom/global.rb', line 24 def adapters @adapters end |
#plugin_registry ⇒ Hash (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.
An internal identifier => plugin map used by the setup
31 32 33 |
# File 'lib/rom/global.rb', line 31 def plugin_registry @plugin_registry end |
Class Method Details
.extended(rom) ⇒ 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.
Set base global registries in ROM constant
12 13 14 15 16 17 |
# File 'lib/rom/global.rb', line 12 def self.extended(rom) super rom.instance_variable_set('@adapters', {}) rom.instance_variable_set('@plugin_registry', PluginRegistry.new) end |
Instance Method Details
#plugins(*args, &block) ⇒ Object
Global plugin setup DSL
41 42 43 |
# File 'lib/rom/global.rb', line 41 def plugins(*args, &block) PluginDSL.new(plugin_registry, *args, &block) end |
#register_adapter(identifier, adapter) ⇒ self
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 adapter namespace under a specified identifier
53 54 55 56 |
# File 'lib/rom/global.rb', line 53 def register_adapter(identifier, adapter) adapters[identifier] = adapter self end |