In Java, == is the strongest kind of equality (pointer equality): a == b always implies a.equals(b). However, in Ruby, == is weaker than .equals?:
ruby-1.9.2-rc2 > 17 == 17.0
=> true
ruby-1.9.2-rc2 > 17.equal?(17.0)
=> false
So, where can I learn more about ==? What kind of checks should I expect when I compare two objects with it?
briefly this is what you need to know:
The
==comparison checks whether two values are equaleql?checks if two values are equal and of the same typeequal?checks if two things are one and the same object.A good blog about this is here.