From: Markus Date: 2004-09-28T02:35:58+09:00 Subject: Re: local_method_missing possible On Mon, 2004-09-27 at 09:53, Mauricio Fern叩ndez wrote: > module Magic > def wrap_method(*names, &block) > names.each do |name| > old = instance_method(name) > define_method(name) do |*a| # |*a, &b| on 1.9 > block.call(name, old.bind(self), *a) # &b on 1.9 > end > end > end > end Note, though, that this will fail under 1.8.1 & 1.8.2Pre (but not, I hope, under later versions) because of the change in block/proc semantics. See: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/113629 http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/113697 (and of course the follow-ons), if you haven't been following that thread already. -- Markus