diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-27 05:23:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-27 05:23:10 +0000 |
commit | 1942710d429d393584a4fa78af8f7984c2c67f72 (patch) | |
tree | 76a71d7a058cc4c2f0b0fcac50f9bddd0dd91579 /lib | |
parent | 770f854176b746226bfba50298450633bf4e1823 (diff) | |
download | ruby-1942710d429d393584a4fa78af8f7984c2c67f72.tar.gz |
* lib/ostruct.rb (modifiable): check if really frozen.
[ruby-core:22559]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ostruct.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb index 45ebb8083e..0ac6852433 100644 --- a/lib/ostruct.rb +++ b/lib/ostruct.rb @@ -68,8 +68,10 @@ class OpenStruct end def modifiable - if self.frozen? - raise TypeError, "can't modify frozen #{self.class}", caller(2) + begin + @modifiable = true + rescue + raise TypeError, "can't modify frozen #{self.class}", caller(3) end @table end |