From: ara.t.howard@... Date: 2006-08-04T06:21:20+09:00 Subject: Re: Creating Classes at runtime On Fri, 4 Aug 2006, Robert Dober wrote: > > > Hmm but that still leaves the OP's question unanswered, how can I create > a named class dynamically. > > eval "class #{x}; end" > myref2class = Object.const_get(x) > > > obviously does the job. ( I agree seems flawed to me too, but OP might have > his reasons ) > > I had a quick look into class.c and it seems that rb_define_class is the > only way to define the name of the class object, which would mean that eval > is the only way to do the trick. > > Any opinnions? i think we've come full circle, but you can do c = Object.const_set 'C', Class.new{} i was just unsure it was actually needed cheers. -a -- happiness is not something ready-made. it comes from your own actions. - h.h. the 14th dali lama