# Re: classless methods

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

</div>

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

> And since Object is an ancestor of pretty much everything in ruby,  
> it’s interesting to note that these methods are now defined for  
> practically everything in ruby:

[snip]

You’re being fooled by some tricks that irb plays to make itself work.

In non-irb, these methods are private methods of Object, and not  
immediately callable:

def say\_hello; “Hello”; end  
[1,2,3].say\_hello  
#=\> tmp.rb:2: private method `say\_hello’ called for [1, 2, 3]:Array  
(NoMethodError)
