module Surrounded::Exceptions

Public Class Methods

define(klass, exceptions:, namespace: Surrounded::Context) click to toggle source
# File lib/surrounded/exceptions.rb, line 3
def self.define(klass, exceptions:, namespace: Surrounded::Context)
  Array(exceptions).each{ |exception|
    unless klass.const_defined?(exception)
      klass.const_set(exception, Class.new(namespace.const_get(exception)))
    end
  }
end