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?