Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
UnboundMethod#==
(untyped other) -> bool
meth == other_meth → true or false
proc.c
View on GitHub ↗
#define unbound_method_eq method_eq
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
Ruby version changes
-
3.2
-
UnboundMethod#==returnstrueif the actual method is same. For example,String.instance_method(:object_id) == Array.instance_method(:object_id)returnstrue. [Feature #18798]
-