These two operator in Ruby look similar but can have different results when comparing Numeric operators.
1.0 == 1 #=> true
1.eql? 1 #=> false
As stated in the docs only override the ‘==’ if needed.
I think you meant to write either
1.eql? 1.0 #=> false
1.0.eql? 1 #=> false
1.eql? 1 #=> true
The reason is that numeric types perform type conversion across == but not eql?
I have helped a dozen companies build and optimize their engineering teams to deliver great products.
Let’s work together and I can align your business needs with your technology initiatives.