From: "nobu (Nobuyoshi Nakada)" Date: 2012-06-01T14:53:45+09:00 Subject: [ruby-core:45361] [ruby-trunk - Feature #4254][Assigned] Allow method transplanting Issue #4254 has been updated by nobu (Nobuyoshi Nakada). Description updated Status changed from Rejected to Assigned What status is this proposal? I don't think the original proposal has been rejected, but only other additional extensions. Possible choice would be: (1) keep current behavior, all method transplanting is prohibited. (2) accept the original proposal only, transplanting is allowed only between modules but disallowed between class and module/class. (3) still look for "relaxed" condition, actually same as (1) but leave this ticket opened. (4) others. I think there is no probable "relaxed" versions, though. ---------------------------------------- Feature #4254: Allow method transplanting https://bugs.ruby-lang.org/issues/4254#change-26947 Author: zimbatm (Jonas Pfenniger) Status: Assigned Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: core Target version: 2.0.0 =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 -- http://bugs.ruby-lang.org/