instance method
silence_redefinition_of_method
Ruby on Rails 5.2.8.1
Since v5.2.8.1Signature
silence_redefinition_of_method(method)
Marks the named method as intended to be redefined, if it exists. Suppresses the Ruby method redefinition warning. Prefer #redefine_method where possible.
Parameters
-
methodreq
Source
# File activesupport/lib/active_support/core_ext/module/redefine_method.rb, line 8
def silence_redefinition_of_method(method)
if method_defined?(method) || private_method_defined?(method)
# This suppresses the "method redefined" warning; the self-alias
# looks odd, but means we don't need to generate a unique name
alias_method method, method
end
end
Defined in activesupport/lib/active_support/core_ext/module/redefine_method.rb line 8
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Module