Not.
true.object_id # => 20 TRUE.object_id # => 20 true == TRUE # => true
But use true as the all-caps version is rare and can be confusing.
This is obviously a constant when it is uppercase, but it is a constant that is initialized with the same object reference as true , so it is not completely different. Remember that Ruby variables and constants are just object references. All this is an object.
The same and different as the English words are hard to define. You can argue all day about the meaning of English words. In OOP, we define the concepts of both identity and equality. In this case, true and true same and equal. Therefore, a Ruby equality comparison returns true and why the object identifiers are equal.
So, I think, given that both actual definitions of OOP in this case are the same, we can also say the same thing. But you do not need it, I think.
source share