From: Nick Sieger Date: 2006-10-28T02:03:53+09:00 Subject: Re: classless methods ------=_Part_44716_18871140.1161968629837 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/27/06, Trans wrote: > > > Dave Rose wrote: > > what class does a classless independent method belong too? > > Not Kernel, it becomes a private method of Object class. > > T. Actually, it looks like it becomes a public instance method of Object: irb(main):001:0> def hello; "hi"; end => nil irb(main):002:0> self.class => Object irb(main):004:0> self.public_methods.include?("hello") => true irb(main):005:0> Object.private_methods.include?("hello") => false irb(main):006:0> Object.private_instance_methods.include?("hello") => false irb(main):007:0> Object.public_instance_methods.include?("hello") => true irb(main):008:0> (class << self; self; end).public_instance_methods.include?("hello") => true /Nick ------=_Part_44716_18871140.1161968629837--