From: "Jesús Gabriel y Galán" Date: 2011-03-31T18:37:21+09:00 Subject: Re: Dynamic classes On Sun, Mar 27, 2011 at 10:38 PM, Vicente Bosch Campos wrote: > I think this Constant "Magic" only works for classes as Robert has indicated. At least I have not seen anything on google or my > bookshelf to do it. > > I personally would not use it, its an exception of how the operator works, and forces people to delve into how your object works which > can be considered as not very clean. But it allows some very nice things, like having ways of creating classes, assign them to constants and have them work as a regularly defined class very easily: ruby-1.8.7-p334 :001 > TestClass = Struct.new :id => TestClass ruby-1.8.7-p334 :004 > TestClass.name => "TestClass" (Struct.new returns a class) Jesus.