From: Jonathan Leighton Date: 2006-03-27T00:30:36+09:00 Subject: Re: Noob: use of the double colon On Sun, 2006-03-26 at 23:44 +0900, dblack@wobblini.net wrote: > Hi -- > > On Sun, 26 Mar 2006, Jonathan Leighton wrote: > > > While we're on the topic -- I've never exactly understood what placing > > the double colon at the beginning does? eg... > > > > ::FooModule::FOO_CONSTANT > > > > ? > > It forces a top-level lookup. For example: > > class M > class String > end > > def initialize > @ms = String.new # this will be M::String > @str = ::String.new("abc") # this will be top-level string > end > end > > It's like a / at the beginning of a file path. Ah okay, thanks very much. -- Jonathan Leighton http://turnipspatch.com/ | http://jonathanleighton.com/ | http://digital-proof.org/