From: Dave Aronson Date: 2013-07-02T05:18:30+09:00 Subject: Re: Why the use of a pound (#) sign with Enumerable On Mon, Jul 1, 2013 at 4:02 PM, Ruby Student wrote: > Please be easy on me, but I was wondering why methods that belong to the > Enumerable class have a # (pound) sign. For instance: > > #all? ... > What is the meaining of the # there? It's not just Enumerable, it's all Ruby classes. The # denotes an instance method (in docs, not code), while :: is used for class/module methods (in both docs and code). So for instance if we have class Foo, with instance-method bar and class-method quux, bar would be *documented* as Foo#bar and *used in code* as whatever_you_call_your_variable.bar, which is why we can't document it that way (we don't know what the variable name will be). Meanwhile, quux would generally be documented as Foo::quux... and could be used as *either* Foo::quux or Foo.quux. That's why documenting instance methods with the classname and a dot could lead to confusion. -Dave -- Dave Aronson, the T. Rex of Codosaurus LLC, secret-cleared freelance software developer taking contracts in or near NoVa or remote. See information at http://www.Codosaur.us/.