Feb 3, 2023
From:
Question: What is an object freezing in Ruby and why would you do that?
Answer: Freezing an object just means preventing it from changing .freeze will do the trick
I would add that .freeze also reduce objects allocations, thus less strings are created and less needed to be garbage collected. I read that this now comes by default on Ruby 3.