From: Stefan Lang Date: 2009-02-15T08:18:02+09:00 Subject: Re: Frozen OpenStruct allows modification 2009/2/14 bhz : > Why does OpenStruct allow modification after it has been frozen? Output is > 20 in both ruby 1.8.6 and 1.9: > > require 'ostruct' > > a = OpenStruct.new() > a.foo = 10 > a.freeze() > a.foo = 20 > puts a.foo Because the OpenStruct instance is never modified here, only the internal hash it uses to store attribute values. The internal hash is not frozen, only the OpenStruct instance itself. Stefan