modifying it in place, particularly adding non-symbol keys.
But what is the proper way of doing this? Should the result be
frozen?
Perhaps #dup? Or both? Or am I being over concerned and we shouldn’t
bother?
If the person is motivated enough to discover this method, s/he will
also be
motivated enough to use `open_struct.send(:instance_variable_get,
:@table)’.
There is no way you can prevent something like this to happen in Ruby.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.