From: MonkeeSage Date: 2006-09-20T23:00:14+09:00 Subject: Re: self.method? Vincent Fourmond wrote: > Based on that, you could try something as follows: > > def who_am_i? > return caller[0] > end > > def meth > p who_am_i? > end > > meth > > As it returns text, you'll need some regular expression handling, but > that could help you... > > Vince, in a ruby mood today... See! I told you that someone smarter than me would come up with a solution! Never say never unless you want to be proven wrong rather quickly! ;) Using Vince's idea: def who_am_i? caller[0].match(/`([^']+)'/)[1] end def meth p who_am_i? end meth # => "meth" :) Regards, Jordan