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
> => #<Class:0x1018ab00>
> >> 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      #=> #<Class:0x401e8874>
  d=c              #=> #<Class:0x401e8874>
  e=d              #=> #<Class:0x401e8874>
  F=e              #=> F
  G=c              #=> F
  c.name           #=> "F"

Bertram

-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de