I have just started learning Ruby and I am going through as much
documentation as I can find. The only question that I cannot seem to
find an answer to concerns the use of the # symbol when referring to
methods (I think I’ve seen it used to refer to both class and instance
methods).
There is a link to “Object#kind_of?” which is an instance method.
Clearly the purpose of the hash mark has another purpose. Anyone know
what document explains this?
is not Ruby syntax, it’s a documentation convention that denotes
“instance method,” as in “kind_of? is an instance method of Object” as
opposed to “class method,” which is distinguished by a period between
the class name and the method name.
There is a link to “Object#kind_of?” which is an instance method.
Clearly the purpose of the hash mark has another purpose. Anyone know
what document explains this?
Basically it means “the instance method kind_of? implemented by the
Object class”; not really syntax, but convention for discussing Ruby.
The ‘ri’ utility uses something similar.
is not Ruby syntax, it’s a documentation convention that denotes
“instance method,” as in “kind_of? is an instance method of Object” as
opposed to “class method,” which is distinguished by a period between
the class name and the method name.
Basically it means “the instance method kind_of? implemented by the
Object class”; not really syntax, but convention for discussing Ruby.
The ‘ri’ utility uses something similar.
Ahh ok, excellent thank you that was confusing me quite a bit.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.