On 14/11/11 10:19, Benoit Daloze wrote:
> On 14 November 2011 07:32, Andrew Grimm <andrew.j.grimm / gmail.com> wrote:
>>
>> Issue #5628 has been updated by Andrew Grimm.
>>
>>
>> I'm not sure about the method name. What should happen with File::basename ? Should it call super when there's no arguments, and do its own thing when called with an argument? I'd prefer Ruby to tell me that I forgot to pass in a string!
> 
> I also agree this would be useful.
> But the name 'basename' is probably not the best.
> I remember I used simple_name for this, but it's not appealing.
> 
I like this - I use .split("::").last all over the place.

A few alternatives, since I agree it would be unfortunate to overload
.basename:

  .inner_name
  .last_name
  .primary_name
  .name( false )
  .name( :full => false )

-- 
Alex