"Florian Gross" <flgr / ccan.de> schrieb im Newsbeitrag
news:2va204F2ie5e5U1 / uni-berlin.de...
> itsme213 wrote:
>
> > Is there a way to give a name to the class? My code generation uses
the
> > class name. I tried assigning it to a constant but get an error:
> >     "dynamic constant assignment"
>
> Yup, via Object.const_set("Foo", Class.new).

Direct assignment works, too:

>> Foo = Class.new String
=> Foo
>> Foo.superclass
=> String
>> Foo.ancestors
=> [Foo, String, Enumerable, Comparable, Object, Kernel]
>> Foo.name
=> "Foo"
>>

Kind regards

    robert