From: Paul Brannan Date: 2001-12-21T05:57:00+09:00 Subject: [ruby-talk:29169] Re: overriding methods: (almost) a replacement for alias_method On Fri, Dec 21, 2001 at 05:10:38AM +0900, Avi Bryant wrote: > I was talking to matz about this issue at OOPSLA, and at least with > the current (CVS) version you should be able to do something like: > > class Foo > old_method = method(:foo) > define_method(:foo) do > #do stuff > old_method.bind(self).call() > end > end > > This could obviously be generalized into an around() method of some > kind. Hmm, with 1.6.5, self inside the Proc is Foo, so the call to bind() will fail, since Foo is not an instance of Foo. Are you telling me that this behavior will change under 1.8? This would definitely be nice. Paul