Forum: Ruby Catch method calls

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Imobach González Sosa (Guest)
on 2006-02-10 12:53
(Received via mailing list)
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/ruby-talk/668.
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!
Erik V. (Guest)
on 2006-02-10 14:03
(Received via mailing list)
This is a good read, if you want to implement such wrapper.
It's not old... :)

 http://tinyurl.com/93yy9

gegroet,
Erik V.
Kent S. (Guest)
on 2006-02-10 17:03
(Received via mailing list)
Check out Kernel#set_trace_func. Note it is very slow!

Kent.
This topic is locked and can not be replied to.