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






Check the object_id before and after the assignment



call = "All hands on deck!" # => "All hands on deck!"
call.object_id # => 1600420
call = "All feet on deck!" # => "All feet on deck!"
call.object_id # => 1009410

 








Related examples in the same category

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