Sha256: a38f8d6a57130a13aea5777b786cd5c2ef3d5db0e7be5b3f4a2eb7d0063d5a8a

Contents?: true

Size: 520 Bytes

Versions: 1

Compression:

Stored size: 520 Bytes

Contents

# encoding: UTF-8
# frozen_string_literal: true

class MethodNotImplemented < StandardError
  VERSION = '1.0.0'

  module Extension
    def method_not_implemented
      method  = caller_locations(1,1)[0].label
      message = case self
        when Class, Module
          "#{self.inspect}.#{method} (class or module method)"
        else
          "#{self.class.inspect}.#{method} (instance method)"
      end

      raise MethodNotImplemented, message
    end
  end
end

Object.include MethodNotImplemented::Extension

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
method-not-implemented-1.0.0 lib/method-not-implemented.rb