class Module

def redefine_singleton_method(method, &block)

the passed block as its body.
Replaces the existing singleton method definition, if there is one, with
def redefine_singleton_method(method, &block)
  singleton_class.redefine_method(method, &block)
end