Module: ROM::Plugins

Extended by:
Dry::Container::Mixin, Enumerable
Defined in:
lib/rom/plugins.rb,
lib/rom/plugins/dsl.rb,
lib/rom/plugins/class_methods.rb,
lib/rom/plugins/command/schema.rb,
lib/rom/plugins/schema/timestamps.rb,
lib/rom/plugins/command/timestamps.rb,
lib/rom/plugins/relation/changeset.rb,
lib/rom/plugins/relation/instrumentation.rb,
lib/rom/plugins/relation/registry_reader.rb

Overview

Registry of all known plugins

Defined Under Namespace

Modules: ClassMethods, Command, Relation, Schema Classes: DSL, Resolver

Class Method Summary collapse

Class Method Details

.[](key) ⇒ 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.



92
93
94
95
96
97
98
# File 'lib/rom/plugins.rb', line 92

def [](key)
  if key?(key)
    super
  else
    Resolver.new(self, type: key)
  end
end

.dsl(*args, &block) ⇒ Object



26
27
28
# File 'lib/rom/plugins.rb', line 26

def dsl(*args, &block)
  Plugins::DSL.new(self, *args, &block)
end

.eachObject

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.



38
39
40
# File 'lib/rom/plugins.rb', line 38

def each
  keys.each { |key| yield(self[key]) }
end

.register(name, type:, **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.



31
32
33
34
35
# File 'lib/rom/plugins.rb', line 31

def register(name, type:, **options)
  Plugin.new(name: name, type: type, **options).tap do |plugin|
    super(plugin.key, plugin)
  end
end

.resolve(key) ⇒ 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.



43
44
45
46
47
# File 'lib/rom/plugins.rb', line 43

def resolve(key)
  super
rescue Dry::Container::Error
  raise ROM::UnknownPluginError, "+#{key}+ plugin was not found"
end