On Mon, 29 Nov 2004 13:34:24 +0900, David A. Black <dblack / wobblini.net> wrote: > Hi -- > > > > On Mon, 29 Nov 2004, Sam Stephenson wrote: > > > On Mon, 29 Nov 2004 11:31:06 +0900, Gavin Sinclair > > <gsinclair / soyabean.com.au> wrote: > > > 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? > > > > Why not String? > > "Test::Unit".to_class # => Test::Unit > > > > My justification: it's analogous to String#to_sym. > > I'm not sure what either of these adds to const_get AFAIK, const_get doesn't handle objects below its namespace, so you can't const_get 'Foo::Bar', you have to Foo.const_get 'Bar'. > -- or, to put it > another way, why there should be a special method to do (essentially) > a const_get only for strings that represent class names. I agree. Maybe String#to_const would be more appropriate? > David > > -- > David A. Black > dblack / wobblini.net Sam