Each object has its own numeric object ID. : object_id « Reflection « Ruby
- Ruby
- Reflection
- object_id
Each object has its own numeric object ID.
# You can find out what this ID is with the object_id method from Object.
myString = "asdf"
whitman = myString # copy one string object to another
whitman == myString # => true
myString.object_id # => 968680
whitman.object_id # => 968680
Related examples in the same category