From: Eero Saynatkari Date: 2006-09-24T00:07:00+09:00 Subject: Re: How do I instantiate a class who's name is dynamic? Ben Harper wrote: > I want to do the following, where 'somefile' is a dynamic value: > require 'somefile.rb' > 'somefile.rb' will have a module inside it named "Magic_Module_somefile" > Inside that module there will be a class named "Magic_Class_somefile" > How do I new() that class ? You want Module#const_get which must be called on the enclosing class or module (split and inject is the standard solution for cases where you have a qualified class name in the ModuleName::ClassName format). -- Posted via http://www.ruby-forum.com/.