Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

UnboundMethod#eql?

(untyped other) -> bool
meth.eql?(other_meth) → true or false

Alias of #==

Two unbound method objects are equal if they refer to the same method definition.

Example
Array.instance_method(:each_slice) == Enumerable.instance_method(:each_slice)
#=> true

Array.instance_method(:sum) == Enumerable.instance_method(:sum)
#=> false, Array redefines the method for efficiency
See also #== #clone #hash #bind_call also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0