diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 21:40:50 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 21:40:50 +0000 |
commit | 315bea116340e3dff6931d9247b9b30ef5f388e9 (patch) | |
tree | 69b6080f22c9ac2891427cfe1159e65ffa1ad38d /lib | |
parent | e74a83603ae93d8a726f6bab9f5a81f98a102948 (diff) | |
download | ruby-315bea116340e3dff6931d9247b9b30ef5f388e9.tar.gz |
* lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a symbol
nor a string. See [#11762]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ostruct.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb index 0e13f40692..84244b3d9e 100644 --- a/lib/ostruct.rb +++ b/lib/ostruct.rb @@ -227,7 +227,7 @@ class OpenStruct begin name = name.to_sym rescue NoMethodError - return + raise TypeError, "#{name} is not a symbol nor a string" end @table.dig(name, *names) end |