module ROM::Global
Globally accessible public interface exposed via ROM
module
@api public
Attributes
adapters[R]
An internal adapter identifier => adapter module map used by setup
@return [Hash<Symbol=>Module>]
@api private
plugin_registry[R]
An internal identifier => plugin map used by the setup
@return [Hash]
@api private
Public Class Methods
extended(rom)
click to toggle source
Set base global registries in ROM
constant
@api private
Calls superclass method
# File 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
Public Instance Methods
plugins(*args, &block)
click to toggle source
Global
plugin setup DSL
@example
ROM.plugins do register :publisher, Plugin::Publisher, type: :command end
@api public
# File lib/rom/global.rb, line 43 def plugins(*args, &block) PluginDSL.new(plugin_registry, *args, &block) end
register_adapter(identifier, adapter)
click to toggle source
Register adapter namespace under a specified identifier
@param [Symbol] identifier @param [Class,Module] adapter
@return [self]
@api private
# File lib/rom/global.rb, line 55 def register_adapter(identifier, adapter) adapters[identifier] = adapter self end