Project

General

Profile

Actions

Feature #4254

closed

Allow method transplanting

Feature #4254: Allow method transplanting

Added by zimbatm (zimba tm) almost 16 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
[ruby-core:34267]

Description

=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


Files


Related issues 1 (1 open — 0 closed)

Related to Ruby - Bug #22562: Type confusion SEGV: Using `super`, `instance_exec`, and `bind_call`, it is possible to run Array#first on an instance of IntegerOpenActions
Actions

Also available in: PDF Atom