Module: ROM::Global
- Included in:
- ROM
- Defined in:
- core/lib/rom/global.rb,
core/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
26 27 28 |
# File 'core/lib/rom/global.rb', line 26 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
33 34 35 |
# File 'core/lib/rom/global.rb', line 33 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
14 15 16 17 18 19 |
# File 'core/lib/rom/global.rb', line 14 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
43 44 45 |
# File 'core/lib/rom/global.rb', line 43 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
55 56 57 58 |
# File 'core/lib/rom/global.rb', line 55 def register_adapter(identifier, adapter) adapters[identifier] = adapter self end |