From: Robert Klemme Date: 2006-07-31T17:25:06+09:00 Subject: Re: using the current method name within current method 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 You can rewrite that as def this_method caller[0][/`([^']*)'/, 1] end and thusly avoid the global variable. Kind regards robert