Getting the name of an invoked method?

S

Simon D. Howard

Hello,

In the C Ruby API, is there a clean way to get the name of the method
which has been invoked? ie. If there is a single C function handling
multiple method calls, is there a way from C to find out which of the
methods was invoked?

The only way I've been able to find of doing this so far is through
poking into the internal stack, eg. rb_id2name(ruby_frame->last_func)
gives the name of the method called. This seems kind of ugly, though.
Is there a cleaner way?

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top