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.
0788f26db45fe53107203f227cd75cb6?d=identicon&s=25 Imobach González Sosa (Guest)
on 2006-02-10 11: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!
2e4e064abe3ea2a2ccc5b64acdc1ab08?d=identicon&s=25 Erik Veenstra (Guest)
on 2006-02-10 13: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.
3ccecc71b9fb0a3d7f00a0bef6f0a63a?d=identicon&s=25 Kent Sibilev (Guest)
on 2006-02-10 16: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.