From: Alex Young Date: 2007-11-08T03:13:01+09:00 Subject: Re: :: and . joey eisma wrote: > hi! > > reading through some tutorial, i noticed the author would interchange using :: and . to call methods. i see they both give the same result. > > i was wondering if there is any other difference between the two? (other than convenience maybe?). when would you use one over the other? > In addition to the other answers, there's one place that you can only use '::' rather than '.', and that's when you're specifying that your constant should be searched for in the root namespace: Bar = 42 module Foo Bar = 23 def Foo.show p ::Bar p Bar end end Foo.show outputs: 42 23 -- Alex