instance method
redefine_method
Ruby on Rails 6.1.7.10
Since v3.0.20Signature
redefine_method(method, &block)
Replaces the existing method definition, if there is one, with the passed block as its body.
Parameters
-
methodreq -
blockblock
Source
# File activesupport/lib/active_support/core_ext/module/redefine_method.rb, line 17
def redefine_method(method, &block)
visibility = method_visibility(method)
silence_redefinition_of_method(method)
define_method(method, &block)
send(visibility, method)
end
Defined in activesupport/lib/active_support/core_ext/module/redefine_method.rb line 17
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Module