Sha256: fe82b74fed1a2ff1b853ee8dc0e2c430230fa61d56aa541a284ea5ef1c118963

Contents?: true

Size: 326 Bytes

Versions: 6

Compression:

Stored size: 326 Bytes

Contents

module Defekt
  module Errors
    class BaseError < StandardError
      def message
        "#{super} (#{self.class.name})"
      end

      def self.name
        super.sub('Defekt::Errors::', '')
      end
    end

    private

    def self.const_missing(klass)
      const_set(klass, Class.new(BaseError))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
defekt-0.0.7 lib/defekt/errors.rb
defekt-0.0.6 lib/defekt/errors.rb
defekt-0.0.5 lib/defekt/errors.rb
defekt-0.0.4 lib/defekt/errors.rb
defekt-0.0.3 lib/defekt/errors.rb
defekt-0.0.2 lib/defekt/errors.rb