From: Gavin Kistner Date: 2006-10-24T05:37:13+09:00 Subject: Re: File::open and File.open From: Brad Tilley > What exactly is the difference between these? :: and . are interchangeable for method calls (I think fully): irb(main):001:0> class Foo; attr_accessor :bar; end => nil irb(main):002:0> f = Foo.new => # irb(main):003:0> f::bar => nil irb(main):004:0> f::bar = 12 => 12 irb(main):005:0> f::bar => 12 "::" must be used for constant lookup: irb(main):001:0> class Foo; BAR = 12; end => 12 irb(main):002:0> Foo::BAR => 12 irb(main):003:0> Foo.BAR NoMethodError: undefined method `BAR' for Foo:Class from (irb):3 Most people (I believe) only use "::" for constants, and "." for all method calls.