From: coigner Date: 2008-03-08T01:24:56+09:00 Subject: Re: Dynamic class thingies? (Okay, not sure how to title this one) On Fri, 07 Mar 2008 10:11:43 -0500, Stefano Crocco wrote: > Alle Friday 07 March 2008, coigner ha scritto: >> Asking for ideas here but let me preface... >> > > You want Kernel.const_get. As the name suggests, it takes a string and > returns the value of the constant with that name. For instance: > > class C > end > > Kernel.const_get('C').new > => # > > If your classes are defined top-level, that's all you need. If they're > defined inside a module, you need to call const_get for that module: > > module M > class C > end > end > > M.const_get('C').new > > I hope this helps Does and thanks. Though I'd already started getting it to work with eval. Which do you think is better? Or does it matter?