Skip to content
This repository
branch: 4-0-stable
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 13 lines (11 sloc) 0.275 kb
1 2 3 4 5 6 7 8 9 10 11 12
class Module
  def remove_possible_method(method)
    if method_defined?(method) || private_method_defined?(method)
      undef_method(method)
    end
  end

  def redefine_method(method, &block)
    remove_possible_method(method)
    define_method(method, &block)
  end
end
Something went wrong with that request. Please try again.