tag:blogger.com,1999:blog-7609658525941194126.post5364356049128823601..comments2022-12-04T23:15:49.314-05:00Comments on Flavor-iffic: Freezing Deep Ruby Data StructuresMikehttp://www.blogger.com/profile/01750555903559042849noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7609658525941194126.post-75666619108458033412011-08-11T09:56:50.465-04:002011-08-11T09:56:50.465-04:00Enumerable is not a good choice because on a Hash,...Enumerable is not a good choice because on a Hash, you'd then only iterate over values. In a deep freeze, you'll want your keys deep-frozen, too. It matters when using complex structures such as arrays containing arrays as keys; the Hash itself only freezes the first level.Digwuren the Grayhttps://www.blogger.com/profile/10614238772441119256noreply@blogger.comtag:blogger.com,1999:blog-7609658525941194126.post-37049178562235104432011-04-20T17:48:33.918-04:002011-04-20T17:48:33.918-04:00Thanks for the tip. I added this to Enumerable ins...Thanks for the tip. I added this to Enumerable instead of to Hash and Array. Works like a charm.Nick Urbanhttps://www.blogger.com/profile/02793417983834256067noreply@blogger.comtag:blogger.com,1999:blog-7609658525941194126.post-64613937958272637662008-09-13T14:49:00.000-04:002008-09-13T14:49:00.000-04:00Hi, excellent code :), I have extended it to freez...Hi, excellent code :), I have extended it to freezing child objects and to preventing simple access to hash and array single elements as well.<BR/><BR/>http://www.semintelligent.com/blog/articles/29/freezing-ruby-data-structures-recursively<BR/><BR/>I give you full credit for your code at the top of the article. Feel free to hack at my code, re-publish on your blog, extend etc as you wish :).<BR/><BR/>Thanks again!Max Schuberthttps://www.blogger.com/profile/06940744796528358518noreply@blogger.com