In Ruby what is the difference between those two (in code):
Class.method
Class#method
It's a naming convention.
#method
for instance methods.method
for class methodsClass::method
for a class method?
.method
is confusing because all methods are called that way. Besides that, class constants are accessed via ::
so it makes sense.
The hash format (Class#method) is not valid ruby, but is used in documentation to describe an instance method.
Class methods are typically documented using a double-colon (Class::method).
You will see examples of both in the ruby docs (e.g. http://www.ruby-doc.org/core-1.9.3/String.html)
The dot format is used in code when actually calling a class method (Class.method), though I have seen some people (unfortunately) use it interchangeably with either the double-colon or hash in documentation.
Class#method
is not valid code. It is only used in documentation. method should be an instance method.
Class.method
or object.method is the actual method belonging to the object. Class is an object too. It is valid code.