Project

General

Profile

Actions

Bug #1898

closed

Method#== for Methods with the Same Body

Added by runpaint (Run Paint Run Run) over 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2009-08-05 trunk 24397) [i686-linux]
Backport:
[ruby-core:24791]

Description

=begin
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).
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0