# Newbie question about the # symbol

**URL:** <https://www.ruby-forum.com/t/newbie-question-about-the-symbol/54801>\
**Category:** Ruby\
**Created:** [March 14, 2006, 2:20pm UTC](https://www.ruby-forum.com/t/newbie-question-about-the-symbol/54801 "2006-03-14T14:20:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@justin](https://www.ruby-forum.com/u/justin)\
**Post date:** [March 14, 2006, 2:20pm UTC](https://www.ruby-forum.com/t/newbie-question-about-the-symbol/54801/1 "2006-03-14T14:20:17Z")

</div>

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).

Here is an example:  
[http://www.rubycentral.com/book/ref\_c\_io.html#IO.select](http://www.rubycentral.com/book/ref_c_io.html#IO.select)

On the above page there is a link to “Kernel#select” which is a class  
method.

and here:  
[http://www.rubycentral.com/book/ref\_c\_object.html#Object.is\_a\_qm](http://www.rubycentral.com/book/ref_c_object.html#Object.is_a_qm)

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?

Thanks!  
Justin

---

<div class="post-metadata">

**Author:** ![justin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@justin](https://www.ruby-forum.com/u/justin)\
**Post date:** [March 14, 2006, 2:34pm UTC](https://www.ruby-forum.com/t/newbie-question-about-the-symbol/54801/2 "2006-03-14T14:34:54Z")

</div>

# 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.

---

<div class="post-metadata">

**Author:** ![justin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@justin](https://www.ruby-forum.com/u/justin)\
**Post date:** [March 14, 2006, 2:35pm UTC](https://www.ruby-forum.com/t/newbie-question-about-the-symbol/54801/3 "2006-03-14T14:35:51Z")

</div>

Justin wrote:

> 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?

The notation’s explained in the preface:

[http://www.rubycentral.com/book/preface.html#S10](http://www.rubycentral.com/book/preface.html#S10)

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.

---

<div class="post-metadata">

**Author:** ![justin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@justin](https://www.ruby-forum.com/u/justin)\
**Post date:** [March 14, 2006, 2:45pm UTC](https://www.ruby-forum.com/t/newbie-question-about-the-symbol/54801/4 "2006-03-14T14:45:55Z")

</div>

On Mar 14, 2006, at 7:33 AM, removed\_email\_address@domain.invalid wrote:

> # 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.

Class methods are also often shown as follows:

MyClass::class\_method

ri even seems to favor this notation.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![justin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@justin](https://www.ruby-forum.com/u/justin)\
**Post date:** [March 14, 2006, 2:45pm UTC](https://www.ruby-forum.com/t/newbie-question-about-the-symbol/54801/5 "2006-03-14T14:45:56Z")

</div>

On Mar 14, 2006, at 7:20 AM, Justin wrote:

> Here is an example:  
> [http://www.rubycentral.com/book/ref\_c\_io.html#IO.select](http://www.rubycentral.com/book/ref_c_io.html#IO.select)
> 
> On the above page there is a link to “Kernel#select” which is a class  
> method.

Actually, all the Kernel methods are instance methods, so they can be  
mixed into Object.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![justin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@justin](https://www.ruby-forum.com/u/justin)\
**Post date:** [March 14, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/newbie-question-about-the-symbol/54801/6 "2006-03-14T14:46:39Z")

</div>

Mike F. wrote:

> 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.
