Check the object_id before and after replace : object_id « Reflection « Ruby
- Ruby
- Reflection
- object_id
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