From: Anurag Priyam Date: 2011-01-29T05:49:22+09:00 Subject: Re: instantiating a class >  Class myClass >  end > >  myVariable="myClass" > > So basically i like to use the content of myVariable to dictate which > class to instantiate, i.e. doing the same thing as myClass.new but let > myVariable determines which class i instantiate. klass = Kernel.const_get(myVariable) foo = klass.new See Module.const_get. Also, you can store a constant reference in a variable too, so you can have the following too: my_variable = my_class # note, I am not using a string here foo = my_variable.new P.S : underscored names are preferred over camel case in Ruby :). -- Anurag Priyam http://about.me/yeban/