From: george.marrows@... (George Marrows) Date: 2004-06-22T17:23:19+09:00 Subject: Re: A question about Class and Object "Sam Sungshik Kong" wrote > I'm using Ruby 1.8. > > Object.class.methods.length #->74 > Object.methods.length #->73 > > Object.class is Class. > Object is type of Class. > > I'm still confused with class and object and metaclass... Hi Sam -- The key is that what class an object is doesn't say everything about what methods it has, because of the existence of singleton methods. [And the list of methods an object has doesn't say everything about what messages it responds to, because of the existence of method_missing - though this is irrelevant to your question :)] James Britt's recent message http://www.ruby-talk.org/104273 explains this, though without mentioning singleton methods explicitly. In this case, the additional method ("nesting") is sneaking in as singleton method on Module: irb(main):015:0> Module.singleton_methods => ["constants", "nesting"] constants is also a Module singleton method, but nesting is the only new one: irb(main):016:0> Object.methods.include?("nesting") => false irb(main):017:0> Object.methods.include?("constants") => true ... hence the difference of 1 in the number of methods that Object and Module have. Hope this helps, George.