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.
···
--
Posted via http://www.ruby-forum.com/.
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.
--
Posted via http://www.ruby-forum.com/.
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
On Tue, 15 Jan 2008 01:14:18 +0900, "Mario Ruiz" <mario@betware.com> said:
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.
--
Posted via http://www.ruby-forum.com/\.
Hi Mario,
have a look at this thread:
http://www.ruby-forum.com/topic/75258
For pre ruby 1.9 you'll have to use a work-around.
cheers
Thibaut
--
http://blog.logeek.fr - about writing software
http://evolvingworker.com - tools for a better day
Thank you very much.
Thibaut Barrère wrote:
Hi Mario,
have a look at this thread:
Using the current method name within current method - Ruby - Ruby-Forum
For pre ruby 1.9 you'll have to use a work-around.
cheers
Thibaut
--
Posted via http://www.ruby-forum.com/\.