From: Eric Hodel Date: 2004-11-18T04:14:26+09:00 Subject: Re: :: vs # (was: Complete set of callbacks) On Nov 17, 2004, at 5:51 AM, trans. (T. Onoma) wrote: > On Wednesday 17 November 2004 06:45 am, trans. (T. Onoma) wrote: > | Please help clarify which are instance methods (#) and which are > class > | methods (::). > > I see why I'm confused now. Take this example: > > --------------------------------------------------------- > Marshal#dump > > > > o = Klass.new("hello\n") > data = Marshal.dump(o) > obj = Marshal.load(data) > obj.sayHello #=> "hello\n" > > > Dump is being used as module/class method so shouldn't it be > 'Marshal::dump' ? > The documentation says they are instance methods, but you can't > initialize a > Marshal. What gives? I've always used :: exclusively for constants, and . for methods. I much prefer :: over . when referencing method names.