Sha256: e1e41f99bd0d104e4a4f125361fd63dcae4d8c036ad285434c25983a55c1e1ed

Contents?: true

Size: 317 Bytes

Versions: 3

Compression:

Stored size: 317 Bytes

Contents

module Surrounded
  module Exceptions
    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
surrounded-1.1.0 lib/surrounded/exceptions.rb
surrounded-1.0.0 lib/surrounded/exceptions.rb
surrounded-0.9.11 lib/surrounded/exceptions.rb