From: Bertram Scharpf Date: 2005-01-28T19:58:17+09:00 Subject: Re: Duping a class causes error Hi, Am Freitag, 28. Jan 2005, 19:05:54 +0900 schrieb Robert Klemme: > > I guess that's not the same as there is some magic involved with class > names: > > >> c = Class.new > => # > >> c.name > => "" > >> Foo = c > => Foo > >> c.name > => "Foo" > >> Foo.name > => "Foo" > >> Bar = c > => Foo > >> Bar.name > => "Foo" > >> c.name > => "Foo" There's nothing magic. The first constant's name that the class is assigned to will be the classes name. c=Class.new #=> # d=c #=> # e=d #=> # F=e #=> F G=c #=> F c.name #=> "F" Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de