From: Aleks Kissinger Date: 2006-08-03T01:52:22+09:00 Subject: Re: using the current method name within current method Depending on how you feel about mucking with core ruby types, a method like this one seems like a decent candidate for mixing in to Object. class Object def this_method caller[0]=~/`(.*?)'/ $1 end end Course I'm one of those crazy irb hack loving people that mixes convenience methods into everything.... > >> Matt Todd wrote: > >>> If you wanted to modularize it just for the sake of it, you could do > >>> something similar to the following: > >>> module CurrentMethodName > >>> def this_method > >>> caller[0]=~/`(.*?)'/ > >>> $1 > >>> end > >>> end