Bug #1898: Method#== for Methods with the Same Body
http://redmine.ruby-lang.org/issues/show/1898

Author: Run Paint Run Run
Status: Open, Priority: Low
Category: DOC
ruby -v: ruby 1.9.2dev (2009-08-05 trunk 24397) [i686-linux]

The documentation for Method#== states "Two method objects are equal if that[sic] are bound to the same object and contain the same body." However, this doesn't seem to be true. Defining a method with either the same literal body or the same block (through define_method) doesn't create equal method objects. If this is intentional, could the documentation be clarified? It appears that methods are equal if:

* They're bound to the same object, and

* They have the same name, or,
* They were designated as aliases with the alias keyword, or
* They're a core method which is an alias.

Is this correct? (No patch because I'm not certain about how it's supposed to work).


----------------------------------------
http://redmine.ruby-lang.org