From: David Alan Black Date: 2001-11-01T02:51:00+09:00 Subject: [ruby-talk:23997] Re: No public methods in 'Object' ? Hello -- On Thu, 1 Nov 2001 holmberg+ruby@iar.se wrote: > > Hi ! > > I'm somewhat confused by the following behaviour: > > $ ruby -e 'p Object.instance_methods.length' > 0 > > Shouldn't "Object" report it's public methods just like any other class ? > I know about the optional parameter to "instance_method": > > $ ruby -e 'p String.instance_methods.length' > 79 > $ ruby -e 'p String.instance_methods(1).length' > 126 > > If I give a true argument to "instance_method" I get: > > $ ruby -e 'p Object.instance_methods(1).length' > 37 > > but since "Object" has no superclass, where does > these 37 methods belong ? All the instance methods, Where do they all come from? All the instance methods, Where do they all belong? Ahh, look at all the instance methods.... Sorry. They come from the Kernel module. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav