1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/ostruct.rb (OpenStruct::method_missing): prohibit modifying

frozen OpenStruct. [ruby-talk:80214]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-08-26 14:54:51 +00:00
parent 4b159597af
commit 1cece7f80f
2 changed files with 8 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Tue Aug 26 23:53:23 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/ostruct.rb (OpenStruct::method_missing): prohibit modifying
frozen OpenStruct. [ruby-talk:80214]
Tue Aug 26 20:03:50 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (create_tmpsrc): add the hook for source.

View file

@ -25,6 +25,9 @@ class OpenStruct
if len != 1
raise ArgumentError, "wrong # of arguments (#{len} for 1)", caller(1)
end
if self.frozen?
raise TypeError, "can't modify frozen #{self.class}", caller(1)
end
mname.chop!
@table[mname.intern] = args[0]
elsif len == 0