You can save the original method as an unbound object object, instead of storing it in an alias.
Then you can use define_method with a block. The block will capture the unbound method_object in closure, allowing you to use it in the new method without polluting your module / class.
The only drawback is that you probably cannot define a method that gives or receives a block in this way:
module Mod unbound_method = instance_method(:original_method) define_method :original_method do |*args|
source share