From: Alex Stahl Date: 2010-11-11T15:55:18+09:00 Subject: Re: what's an object? --=-InNyTt/2EUtOtXITdH2f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Not that I know the internals of the language well enough to debate the internal representation of a method, everything I've read suggests that, at a conceptual level, they can be regarded as such. Otherwise, how would we reconcile this description from the Method class link? (http://ruby-doc.org/core/classes/Method.html) meth == other_meth => true or false "Two method objects are equal if that are bound to the same object and contain the same body" Couldn't methods be considered specialized proc objects bound to a particular instantiation of an object? Also, there's this description at the link you provided: obj.method(sym) => method "Looks up the named method as a receiver in obj, returning a Method object (or raising NameError). The Method object acts as a closure in obj‘s object instance, so instance variables and the value of self remain available." ________________________________________________________________________ Alex Stahl | Sr. Quality Engineer | hi5 Networks, Inc. | astahl@hi5.com | On Wed, 2010-11-10 at 22:25 -0600, 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. > --=-InNyTt/2EUtOtXITdH2f--