From: Joey Date: 2006-05-21T16:34:45+09:00 Subject: Re: How to intercept all function calls of a object? ------=_Part_2398_29360761.1148196883484 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline You could look at http://onestepback.org/index.cgi/Tech/Ruby/BlankSlate.rdoc, this is a good start. j`ey http://wwww.eachmapinject.com On 5/21/06, uncutstone wu wrote: > > What I want is something like this: > > class HelloBye > def hello > puts "hello" > end > def bye > puts "byebye" > end > end > > a =3D HelloBye.new > a.extend #add an intercptor to a > a.hello > > Then I can get this kind of result: > > call method hello of class HelloBye > hello > return from method hello of class HelloBye > > And similar thing for 'bye' and other methods if existed in object a. > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_2398_29360761.1148196883484--