Module: ROM::Plugins::ClassMethods

Included in:
Command, Components::DSL::Core, Mapper, Relation, Transformer
Defined in:
lib/rom/plugins/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#pluginsObject

Return all available plugins for the component type



23
24
25
# File 'lib/rom/plugins/class_methods.rb', line 23

def plugins
  @plugins ||= ROM.plugins[component_config.type].adapter(component_config.adapter)
end

#use(name, **options) ⇒ Object

Include a registered plugin in this relation class

Parameters:

  • plugin (Symbol)
  • options (Hash)

Options Hash (**options):

  • :adapter (Symbol) — default: :default

    first adapter to check for plugin



14
15
16
17
18
# File 'lib/rom/plugins/class_methods.rb', line 14

def use(name, **options)
  plugin = plugins[name].configure(**options).enable(self).apply
  component_config.plugins << plugin
  self
end