From: bhz Date: 2009-02-15T18:43:26+09:00 Subject: Re: Frozen OpenStruct allows modification On Sun, 15 Feb 2009 00:59:20 +0100, Robert Klemme wrote: > On 15.02.2009 00:18, Stefan Lang wrote: >> 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. > > That could still be considered a bug and IMHO it is. > > Kind regards > > robert Agreed.