Exception: MethodAlreadyDefined

Inherits:
StandardError
  • Object
show all
Defined in:
lib/runtime/kernel.rb

Overview

Define a class inheriting from StandardError to raise when a method is already defined

Constant Summary collapse

ERROR_MESSAGE =
'Method %<method_name>s already defined'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(method_name) ⇒ MethodAlreadyDefined

Returns a new instance of MethodAlreadyDefined.



25
26
27
# File 'lib/runtime/kernel.rb', line 25

def initialize(method_name)
  super(format(ERROR_MESSAGE, method_name: method_name))
end