Classless methods

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

···

From: Nick Sieger [mailto:nicksieger@gmail.com]

Good catch, thanks for the correction.

···

On 10/27/06, Gavin Kistner <gavin.kistner@anark.com> wrote:

From: Nick Sieger [mailto:nicksieger@gmail.com]
> 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: