From: "Mauricio Fernández" Date: 2004-06-02T04:41:09+09:00 Subject: Re: [Ruby2]how to dynamically attach :pre :post :wrap ro methods? On Wed, Jun 02, 2004 at 03:53:41AM +0900, gabriele renzi wrote: > Would we have something like this: > > myobj.methods.each do |m| > m.wrap(:pre) {|*args| p args } > end > > ? > Sounds obvious and necessary to me, but I can't remeber talks about > this.. See http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/97440 Something similar can be implemented trivially using the same principle, with Object#method instead of Module#instance_method and using the singleton class. -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com ...Deep Hack Mode -- that mysterious and frightening state of consciousness where Mortal Users fear to tread. -- Matt Welsh