# Re: classless methods

**URL:** <https://www.ruby-forum.com/t/re-classless-methods/73880>\
**Category:** Ruby\
**Created:** [October 27, 2006, 7:10pm UTC](https://www.ruby-forum.com/t/re-classless-methods/73880 "2006-10-27T19:10:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 27, 2006, 7:10pm UTC](https://www.ruby-forum.com/t/re-classless-methods/73880/1 "2006-10-27T19:10:04Z")

</div>

From: Nick S. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> Actually, it looks like it becomes a public instance method of Object:  
> [snip]  
> irb is messing with your head here. Try the same as a standalone Ruby  
> program:

def hello; end  
p self.class  
#=\> Object  
p self.public\_methods.include?(“hello”)  
#=\> false  
p Object.private\_methods.include?(“hello”)  
#=\> true  
p Object.private\_instance\_methods.include?(“hello”)  
#=\> true  
p Object.public\_instance\_methods.include?(“hello”)  
#=\> false  
p (class \<\< self; self; end).public\_instance\_methods.include?(“hello”)  
#=\> false

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 27, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/re-classless-methods/73880/2 "2006-10-27T19:20:05Z")

</div>

On 10/27/06, Gavin K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> From: Nick S. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]
> 
> > Actually, it looks like it becomes a public instance method of Object:  
> > [snip]  
> > irb is messing with your head here. Try the same as a standalone Ruby  
> > program:

Good catch, thanks for the correction.
