From: Henry Savr Date: 2006-08-25T01:44:21+09:00 Subject: Re: How to - Get method's name? Eero Saynatkari wrote: > class Object > def method_name() > # Use Kernel.caller and some string manipulation here > end > end > > class Foo > def foo > puts "My name is #{self.method_name}!" > end > end > > I just do not see why this would be necessary. > >> Thank you, >> Henry Thank you, sorry I had no chance to see it earlier Regarding where it could be useful: When you have to monitor app, which consists of thousands methods. Monitor examples: process management, testing, security, etc... In general, when somebody works for you, it is not a bad idea, to know his/her name. It could be useful sometimes. So I was wandering. Kernel uses and even sends a method name to app, and I hoped, that it would share this knowledge with app by asking. According you, it does not. So, yes, thank you. I will have to cheat :)) and simulate errors until Ruby developers will implement this in future editions. I hope they read the forum. -- Posted via http://www.ruby-forum.com/.