Class: ROM::Plugin

Inherits:
PluginBase show all
Includes:
Configurable
Defined in:
lib/rom/plugin.rb

Overview

Plugin is a simple object used to store plugin configurations

Instance Attribute Summary

Attributes inherited from PluginBase

#mod, #options, #type

Instance Method Summary collapse

Methods included from Configurable

#config, #configure

Methods inherited from PluginBase

#initialize, #relation?, #schema?

Constructor Details

This class inherits a constructor from ROM::PluginBase

Instance Method Details

#apply_to(klass, options = EMPTY_HASH) ⇒ 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 provided class

Parameters:

  • klass (Class)


17
18
19
20
21
22
23
# File 'lib/rom/plugin.rb', line 17

def apply_to(klass, options = EMPTY_HASH)
  if mod.respond_to?(:new)
    klass.send(:include, mod.new(options))
  else
    klass.send(:include, mod)
  end
end