rails/rails — pull request #16560 by robin850 (2014-08-19 16:34:24+00:00)
Title: Define the Duration#instance_of? method

Hello,

This pull request adds the `#instance_of?` method to the `ActiveSupport::Duration` object. Since it is extending from `ProxyObject` which extends itself from `BasicObject`, it doesn't respond to the `#instance_of?` method. Thus, the `#method_missing` hook get triggered, delegating the method to its `value` attribute.

However, Rubinius' `#eql?` definition relies on `#instance_of?`, thus this will equal to true with a Fixnum (since its `value` attribute is a Fixnum) while it should not.

The previous behavior was wrong anyway, no matter the implementation.

Have a nice day.