Why are methods in Ruby documentation preceded by a hash sign?

Note that the convention is:

Class#method

rather than

object#method

In code you would have object.method, if object was an instance of class. The # convention is not used in code.

From the RDoc documentation:

Use :: for describing class methods, # for describing instance methods, and use . for example code.

Leave a Comment