concept two object in category ruby

appears as: two objects, two objects
The Well-Grounded Rubyist, Third Edition

This is an excerpt from Manning's book The Well-Grounded Rubyist, Third Edition.

Having a unique ID number for every object can come in handy when you’re trying to determine whether two objects are the same as each other. How can two objects be the same? Well, the integer object 100 is the same as ... the integer object 100. (Ask 100 for its object ID twice, and the result will be the same.) And here’s another case:

a = Object.new
b = a
puts "a's id is #{a.object_id} and b's id is #{b.object_id}."

Even though the variables a and b are different, the object they both refer to is the same. (See section 2.5.1 for more on the concept of object references.) The opposite scenario can happen too: sometimes two objects appear to be the same, but they’re not. This happens a lot with strings. Consider the following example:

The Object class defines three equality-test methods: ==, eql?, and equal?. At the Object level, all equality-test methods do the same thing: they tell you whether two objects are exactly the same object. Here they are in action: