From: Jason Roelofs Date: 2010-12-04T00:46:11+09:00 Subject: Re: cast object to object On Dec 3, 2010, at 10:39 AM, David E. wrote: > Yeah maybe the string confused things. I don't want to even convert to > string. > > The value in string is the "human name" of the class i want to convert > it to. > > So i'm converting a string into an object of class type of the string > value. > > So convert "Dave" into an object of type Dave() > > -- > Posted via http://www.ruby-forum.com/. > Use Ruby's reflectivity: obj = const_get(string).new assuming #string has a value that's the exact name of the const you're trying to find. Jason