3 ms·
When I try to modify a frozen hash it raises an exception "Can't modify a frozen hash" in ruby 2.2. I generally agree with the rest of your comment though, how
by grandalf 12y ago
When I try to modify a frozen hash it raises an exception "Can't modify a frozen hash" in ruby 2.2.
I generally agree with the rest of your comment though, however I think some ruby code (per the original post) can be improved by introducing some of these paradigms.
- jarkko 12y agoYes, but you only freeze the hash, not the items it contains. It is also an issue for thread safety, as I wrote here: https://bearmetal.eu/theden/how-do-i-know-whether-my-rails-app-is-thread-safe-or-not/ https://bearmetal.eu/theden/how-do-i-know-whether-my-rails-a...