Austin Ziegler wrote:
> 
> For top-level objects, this is as simple as:
> 
>   name = 'Array'
>   klass = Object.const_get(name)
>   p klass # => Array
> 
> For nested values, it's:
> 
>   name = 'Transaction::Simple::Group'
>   klass = name.split(/::/).inject(Object) { |k, n| k.const_get(n) }
>   p klass # => Transaction::Simple::Group
> 

Quite right. There is also the eval (evil?) method:

   clazz = eval(name)


BTW, I've wondered why Object.const_get doesn't honor
the X::Y::Z form. It's unambiguous and I can't see a
good reason not to decipher it.


Hal