diff options
Diffstat (limited to 'lib/ostruct.rb')
-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 |