Need to make certain Ruby strings in my program to be immutable. What is the best solution? Writing a wrapper over String class?
The freeze method won't work for me. I see that freeze won't allow you to unfreeze the object.
Following is my situation: I have a class that passes a string to a callback. This string happens to be an instance variable of the class and can be potentially large. I don't want the callback to modify it, but still allow the class to modify it at will.