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

                                    
                                                                 
                          
       
     
 



                                     
   
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