aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/remove_method.rb
blob: b8c01aca0e40af27ad3bf19c9b1af8e5324697ec (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                                    




                                     
  
class Module
  def remove_possible_method(method)
    remove_method(method)
  rescue NameError
  end
  
  def redefine_method(method, &block)
    remove_possible_method(method)
    define_method(method, &block)
  end
end