From: Pit Capitain Date: 2005-03-08T17:45:49+09:00 Subject: Re: aliasing an external method from within a method definition? Francis Hwang schrieb: > Is there a way to define a method that aliases some external method > without assigning that method to a global in the first place? > ... > This works, but then I'm leaving a global variable just sitting around. > Is there a better way to do this? If you don't mind a local variable then this might help: m = Module.new class << m define_method(:join, &File.method(:join)) def method_missing(*args) args end end Object.send(:remove_const, :File) File = m p File.join("a", "b") # => "a/b" p File.open("x", "y", "z") # => [:open, "x", "y", "z"] Regards, Pit