how to get the method name

M

Mario Ruiz

I need to get the method name automatically like we do with the classes:

puts self.class.to_s()

I'm trying: self.method.to_s() or self.class.method.to_s() but it
doesn't work.
 
C

Carlos J. Hernandez

I don't think I've got your question exactly, but
self.methods returns an array of all methods defined in self.
If not exactly what you want, probably
one of the Object class methods for self inspection is what you are
looking for.
-Carlos
 

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

Forum statistics

Threads
473,812
Messages
2,569,695
Members
45,478
Latest member
dontilydondon

Latest Threads

Top