Project

General

Profile

Feature #4254

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

=begin 
 
  Is there a technical reason to not allow re-binding a method from one module to any other module ? 
 
   
 
    module M 
     
      def foo; "foo"; end 
   
    end 

   
 
    module N; end 
   
    N.send(:define_method, :foo, M.instance_method(:foo)) #=> should not raise 
 
 
 
  It's like monkey-patching. Powerful, dangerous, but also really useful. It could allow different variations of method_wrap or alias_method_chain that are not possible right now. 
 =end 

Back