From: Gennady Bystritsky Date: 2008-03-07T03:31:21+09:00 Subject: Re: Double colon vs module block Daniel Mendler wrote: > Hi! > > I am new to ruby. I have a question concerning namespaces. Is there a > difference between using the double colon operator or a module block? > Example: > > module Library > class Book > end > end > > vs. > > class Library::Book > end Yes, there is. The second form will give you an error if module Library was never defined with 'module' keyward. To ensure that the second form always works, you may do the following: module Library end class Library::Book end This will work even if module Library was previously defined. Gennady.