Class: ROM::Global::PluginDSL

Inherits:
Object
  • Object
show all
Defined in:
core/lib/rom/global/plugin_dsl.rb

Overview

plugin registration DSL

Instance Method Summary collapse

Instance Method Details

#adapter(type, &block) ⇒ Object

Register plugins for a specific adapter

Parameters:

  • type (Symbol)

    The adapter identifier



46
47
48
# File 'core/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) ⇒ Object

Register a plugin

Parameters:

  • name (Symbol)

    of the plugin

  • mod (Module)

    to include

  • options (Hash) (defaults to: EMPTY_HASH)


37
38
39
# File 'core/lib/rom/global/plugin_dsl.rb', line 37

def register(name, mod, options = EMPTY_HASH)
  registry.register(name, mod, defaults.merge(options))
end