From: Florian Gross Date: 2004-09-28T17:19:22+09:00 Subject: Re: Best name for "this method" ? trans. (T. Onoma) wrote: > On Monday 27 September 2004 08:49 pm, Florian Gross wrote: > >>JavaScript uses callee for the first-class version. >> >> >>> # Returns the current method or method name >>> def calling(firstclass=false) >>> m = /\`([^\']+)\'/.match(caller(1).first)[1] >>> return ( firstclass ? method( m ) : m.intern ) >>> end >> >>Personally, I'd dump the first-class logic and call it method_name. It >>is easy enough to turn that into a Method anyway. > > Then what about #called for just the method name? > > def my_method > p called > end Why not method_name? called() is a bit ambiguous IMHO... Regards, Florian Gross