From: "David A. Black" Date: 2004-09-28T09:09:30+09:00 Subject: Re: Best name for "this method" ? Hi -- On Tue, 28 Sep 2004, trans. (T. Onoma) wrote: > Wondering what the conscensus is on the best name for "this method". Right now > I'm using #calling, taking after #binding, but I'm not so sure about it. I've > also considered #this or #thus, to be more along the lines of 'self'. > > # Returns the current method or method name > def calling(firstclass=false) > m = /\`([^\']+)\'/.match(caller(1).first)[1] > return ( firstclass ? method( m ) : m.intern ) > end > > Also, will a method like this be implemented in future Ruby? If so, I hope it won't have the boolean flag. I think those flags, such as instance_methods(false), etc., are the most obscure, cryptic thing in Ruby. I'd like to see them disappear. David -- David A. Black dblack@wobblini.net