I would like to delete an object, I cannot. Here is an example:
irb(main):001:0> str = "hello"
"hello"
irb(main):003:0> str.object_id
2164703880
irb(main):004:0> str = nil
nil
irb(main):005:0> str.object_id
4
As you can see, I can just set the object variable to nil (and then, of course, its object identifier will be 4). And after that, the garbage collector will automatically delete the unused object with the identifier: 2164703880.
But no, I do not want this. I want to delete this object.
Thanks for any ideas, suggestions.
source
share