Check the object_id before and after replace : object_id « Reflection « Ruby






Check the object_id before and after replace



call = "All hands on deck!" # => "All hands on deck!"
call.object_id # => 1624370
call.replace "All feet on deck!" # => "All feet on deck!"
call.object_id # => 1624370

 








Related examples in the same category

1.Each object has its own numeric object ID.
2.Check the object_id before and after the assignment
3.object_id is not changing