From: Ryan Davis Date: 2002-10-02T17:19:40+09:00 Subject: Re: current method On Tuesday, October 1, 2002, at 08:07 AM, Volkmann, Mark wrote: > Is there a way to programmatically determine the name of the method > that is currently being executed? I'd like to use this for logging > purposes. Here is what I had to do for RubyInline (1): def caller_method_name() /\`([^\']+)\'/.match(caller(2).first)[1] end Note, this is two levels up, you want one level up. Perhaps: def my_method_name() /\`([^\']+)\'/.match(caller(1).first)[1] end is an appropriate name. 1) http://sourceforge.net/projects/rubyinline/