Sha256: 653b0ac9f5a230bd783b3c2550f9fadebd9d40a5b1fb7a6fae4be98347e7b6d0
Contents?: true
Size: 464 Bytes
Versions: 292
Compression:
Stored size: 464 Bytes
Contents
class Module def remove_possible_method(method) if method_defined?(method) || private_method_defined?(method) remove_method(method) end rescue NameError # If the requested method is defined on a superclass or included module, # method_defined? returns true but remove_method throws a NameError. # Ignore this. end def redefine_method(method, &block) remove_possible_method(method) define_method(method, &block) end end
Version data entries
292 entries across 248 versions & 26 rubygems