[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Catch method calls

Imobach González Sosa

2/10/2006 10:54:00 AM

Hi all,

We were wondering if it's possible to catch all method calls. I mean a kind
of 'hook' that allow you to do something just before a method is executed.

Browsing in the mailing list's archives, we read this thread about this
topic: http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/rub.... Anyway,
this thread is pretty old, so we'd like to know if nowadays exists a
mechanism to do that.

Thank you all in advance!

--
Imobach González Sosa
imobachgs at gmail dot com
2 Answers

Erik Veenstra

2/10/2006 12:02:00 PM

0


This is a good read, if you want to implement such wrapper.
It's not old... :)

http://tinyurl...

gegroet,
Erik V.

Kent Sibilev

2/10/2006 3:04:00 PM

0

Check out Kernel#set_trace_func. Note it is very slow!

Kent.

On 2/10/06, Imobach González Sosa <imobachgs@gmail.com> wrote:
> Hi all,
>
> We were wondering if it's possible to catch all method calls. I mean a kind
> of 'hook' that allow you to do something just before a method is executed