From: Josh Cheek Date: 2010-11-11T16:51:46+09:00 Subject: Re: what's an object? --0016e646514856e12e0494c2317d Content-Type: text/plain; charset=ISO-8859-1 On Wed, Nov 10, 2010 at 10:25 PM, Y. NOBUOKA wrote: > > Simple answer: everything. Everything is considered an object, > > including an instance of a class, the class itself, its methods, etc. > > There is one thing incorrect. > In Ruby, an instance of a class or a class itself is exactly an object, > while a method is NOT an object. > > Although we can obtain a Method object using the *Object#method* > method [ http://ruby-doc.org/core/classes/Object.html#M000336 ], a > method itself is not an object. > > This seems self-contradictory, how is a method not an object? On Wed, Nov 10, 2010 at 11:55 PM, timr wrote: > > Alex said everything is an object--including an instance of a class, > the class itself, its methods. I agree up until he mention methods as > objects. I don't think that can be demonstrated. For instance, we > cannot get the object_id of a method. '+.object_id' doesn't work. So, > I don't agree that methods are objects. > > 1.method('+').object_id --0016e646514856e12e0494c2317d--