From: "Jesús Gabriel y Galán" Date: 2013-04-11T22:07:09+09:00 Subject: Re: confusion with Struct class On Thu, Apr 11, 2013 at 12:19 PM, Love U Ruby wrote: > "Jesús Gabriel y Galán" wrote in post > #1105232: >> On Thu, Apr 11, 2013 at 10:45 AM, Love U Ruby >> wrote: >>> >> If you read the doc you referenced closely: >> > ***the name of this struct >> will appear as a constant in class Struct***, > > Yes,I am confused how a full class be a constant. We can create a > variable as a constant, say "NAME". class and module names are also > constant. But full class body is constant - I just newly step into this > topic. 1.9.2p290 :001 > class S 1.9.2p290 :002?> Foo = Class.new 1.9.2p290 :003?> end => S::Foo 1.9.2p290 :004 > S::Foo => S::Foo A class can have constants inside. Those constants can reference any object, for example a Class. There's nothing really more to it than this. You refer to a constant inside a class with the :: syntax as shown above. Jesus.