From: Marnen Laibow-Koser Date: 2010-01-18T09:37:02+09:00 Subject: Re: name of method? Gary Wright wrote: > On Jan 17, 2010, at 5:29 PM, Ralph Shnelvar wrote: > >> How do I get the name of a method? >> >> def xxx >> @WhatsMyName = ??? >> end > > In Ruby 1.9: > > def foo > puts "this is method: #{__method__}" > end > > You can also use __callee__. > > Gary Wright Cool! Didn't know about that. Best, --  Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/.