From: Ola Bini Date: 2006-05-10T13:40:56+09:00 Subject: Re: Intantiating a class by name Hi. Say that you get a String like "A::B::C" and would like this instantiated: obj_class = Object name.split( "::" ).each { |c| obj_class = obj_class.const_get( c ) } if name o = obj_class.new Regards Ola Bini ----- Original Message ----- From: "Erich L. Timkar" Date: Wednesday, May 10, 2006 6:32 am Subject: Intantiating a class by name To: ruby-talk@ruby-lang.org (ruby-talk ML) > For the life of me I haven't been able to find the syntax to > "instatiate" a class given it's name. I know it's silly. I feel > silly > and when I hear the answer, I'll fill twice as silly. Anyone wanna > take > a stab at this and put me out of my misery? > > erich > > -- > Posted via http://www.ruby-forum.com/. > >