class Dry::Plugins::Registry::KeyError

Plug-in registration error

Public Class Methods

new(registry, key, plugin) click to toggle source
Calls superclass method
# File lib/dry/plugins/registry/key_error.rb, line 10
        def initialize(registry, key, plugin)
          super <<~ERROR
            Cannot register #{key.inspect} in #{registry.inspect}
              as
                #{indent plugin.inspect}
              since previously registered
                #{indent registry[key].inspect}
          ERROR
        end

Private Instance Methods

indent(lines, indentation: ' ' * 4, glue: "\n") click to toggle source
# File lib/dry/plugins/registry/key_error.rb, line 22
def indent(lines, indentation: ' ' * 4, glue: "\n")
  indentation + lines.to_s.split(/\n/).join("#{indentation}#{glue}") + glue
end