Sha256: 1a5896219123c08110f6c0a50fe6c286ad1b00877e123ccfc76548a178aaebe6

Contents?: true

Size: 566 Bytes

Versions: 3

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

require 'rom/constants'
require 'rom/plugin_base'
require 'rom/support/configurable'

module ROM
  # Plugin is a simple object used to store plugin configurations
  #
  # @private
  class Plugin < PluginBase
    include Configurable

    # Apply this plugin to the provided class
    #
    # @param [Class] klass
    #
    # @api private
    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rom-core-5.0.2 lib/rom/plugin.rb
rom-core-5.0.1 lib/rom/plugin.rb
rom-core-5.0.0 lib/rom/plugin.rb