aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:13:19 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:13:19 +0000
commitb9e18abe4a881a638d0c6cfbbffeacea43813e86 (patch)
treef63472b042e0adcae44d8b3e7e995eeade114541 /lib/ostruct.rb
parentdc215dcd9f96620b7c06a25a741d13b19c2f130b (diff)
downloadruby-b9e18abe4a881a638d0c6cfbbffeacea43813e86.tar.gz
* lib/ostruct.rb: Raise RuntimeError when modifying frozen instances
instead of TypeError. Patch by Kenichi Kamiya. [Fixes GH-383] * test/ostruct/test_ostruct.rb: Added tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r--lib/ostruct.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index df09cc953f..6b60bdf3fe 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -152,7 +152,7 @@ class OpenStruct
begin
@modifiable = true
rescue
- raise TypeError, "can't modify frozen #{self.class}", caller(3)
+ raise RuntimeError, "can't modify frozen #{self.class}", caller(3)
end
@table
end