From: "David A. Black" Date: 2005-12-01T04:30:06+09:00 Subject: Re: Dumb question: in documentation, why Object#method, and not Object.method ? Hi -- On Thu, 1 Dec 2005, Marcel Molina Jr. wrote: > On Thu, Dec 01, 2005 at 04:17:30AM +0900, Elf M. Sternberg wrote: >> I keep seeing this syntax in documentation: Object#method, but in actual >> use sending a message to an object is usually >> >> object = Object.new >> object.method >> >> Is this just to emphasize that method() operates on an instance of >> Object and not the class Object? > > The # is a naming convention. > > Class#method means method is an instance method. > Class::method means method is a class method. > > For example, do > > ri IO.read > > There is IO::read and IO#read. Interesting -- I never picked up on ri's use of :: in preference to the dot. I personally use Class.method for class methods (indeed for any singleton method). David -- David A. Black dblack@wobblini.net