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.