class ROM::Global::PluginDSL
plugin registration DSL
@private
Attributes
defaults[R]
Default options passed to plugin registration
@return [Hash]
@api private
registry[R]
Public Class Methods
new(registry, defaults = EMPTY_HASH, &block)
click to toggle source
@api private
# File lib/rom/global/plugin_dsl.rb, line 24 def initialize(registry, defaults = EMPTY_HASH, &block) @registry = registry @defaults = defaults instance_exec(&block) end
Public Instance Methods
adapter(type, &block)
click to toggle source
Register plugins for a specific adapter
@param [Symbol] type The adapter identifier
@api public
# File lib/rom/global/plugin_dsl.rb, line 46 def adapter(type, &block) self.class.new(registry, adapter: type, &block) end
register(name, mod, options = EMPTY_HASH)
click to toggle source
Register a plugin
@param [Symbol] name of the plugin @param [Module] mod to include @param [Hash] options
@api public
# File lib/rom/global/plugin_dsl.rb, line 37 def register(name, mod, options = EMPTY_HASH) registry.register(name, mod, defaults.merge(options)) end