Add === to UnboundMethod
UnboundMethod class should have
=== so that it can be used in case statement.
Method class has
=== method so that we can do something like:
require 'prime' case 11 when Prime.method(:prime?) then :prime end
However, we cannot do something like this:
positive = Integer.instance_method(:positive?) case 11 when positive then :positive end
=== method to
Minimal implementation in Ruby could be:
class UnboundMethod def ===(other) bind(other).call end end
UnboundMethod can improve readability in case statement.