On Mon, 29 Nov 2004 11:31:06 +0900
Gavin Sinclair <gsinclair / soyabean.com.au> wrote:

> Hi all,
> 
> I'm preparing some methods for 'extensions' [1] and would like some
> people's opinions on method names.
> 
>   Array#only
>     [5].only      -> 5
>     [1,2,3].only  -> exception
> 

Maybe to_scalar would tell more clearly what it is doing?

>   Class.get_class
>     Class.get_class("Test::Unit")  -> Test::Unit
>     Class.get_class("not-a-class") -> exception
> 
>     # Should 'get_class' be in Class or in Kernel?
> 

I'd call it Class.by_name(sym)

regards,

Brian

-- 
Brian Schröäer
http://www.brian-schroeder.de/