From: Brian Candler Date: 2003-07-01T01:14:24+09:00 Subject: Re: dynamic object creation On Tue, Jul 01, 2003 at 01:01:25AM +0900, Aryeh Friedman wrote: > If I have something like this: > > s="Array" > > How whould I get something like this: > > aObject=s.new > > In "plain" english I am asking if I have a valid name of a class in a > string how do I create an instance of the class the string contains? A class name is just a constant, so something like a = Module.const_get("Array").new is what you need (Aside: what's the proper way to access 'the top-level Module', or is the above correct?) Cheers, Brian.