Class: ROM::Plugin

Inherits:
Object
  • Object
show all
Extended by:
Initializer
Includes:
Configurable
Defined in:
lib/rom/plugin.rb

Overview

Plugin is a simple object used to store plugin configurations

Direct Known Subclasses

SchemaPlugin

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#modModule (readonly)

Returns a module representing the plugin.

Returns:

  • (Module)

    a module representing the plugin


23
# File 'lib/rom/plugin.rb', line 23

param :mod

#nameSymbol (readonly)

Returns plugin name.

Returns:

  • (Symbol)

    plugin name


18
# File 'lib/rom/plugin.rb', line 18

param :name

#typeSymbol (readonly)

Returns plugin type.

Returns:

  • (Symbol)

    plugin type


28
# File 'lib/rom/plugin.rb', line 28

option :type

Instance Method Details

#apply_to(target, **options) ⇒ 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.

Apply this plugin to the target

Parameters:

  • target (Class, Object)

35
36
37
38
39
40
41
42
43
# File 'lib/rom/plugin.rb', line 35

def apply_to(target, **options)
  if mod.respond_to?(:apply)
    mod.apply(target, **options)
  elsif mod.respond_to?(:new)
    target.include(mod.new(**options))
  elsif target.is_a?(::Module)
    target.include(mod)
  end
end

#configConfig Originally defined in module Configurable

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.

Return config instance

Returns:

#configure {|config| ... } ⇒ self Originally defined in module Configurable

Yield config instance

Yields:

Returns:

  • (self)