Indeed:
Comparable.instance_methods # => [:clamp, :<=, :>=, :==, :<, :>, :between?]
Complex.ancestors # => [Complex, Numeric, Comparable, Object, PP::ObjectMixin, Kernel, BasicObject]
Complex.instance_methods.select{Comparable.instance_methods.include? _1} # => [:==]
Of course, == is also defined in BasicObject, so even == doesn't count that much.
How is that possible? Can you remove an ancestor method in Ruby?
Is it possible to remove methods at all?
You can remove a method in two ways,
undef_methodandremove_methodundef_methodwill remove the ability to call the method competely, butremove_methodwill remove just the current method, letting you fall back to the super method if it exists.