Sha256: 31fc508d43ad37bcb19c93600064d6d1da1f8daf2e3ae66fbbec91009282846c
Contents?: true
Size: 420 Bytes
Versions: 5
Compression:
Stored size: 420 Bytes
Contents
class Module # Removes the named method, if it exists. def remove_possible_method(method) if method_defined?(method) || private_method_defined?(method) undef_method(method) end end # Replaces the existing method definition, if there is one, with the passed # block as its body. def redefine_method(method, &block) remove_possible_method(method) define_method(method, &block) end end
Version data entries
5 entries across 5 versions & 1 rubygems