aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-27 07:30:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-27 07:30:42 +0000
commit490979c719f51bea44b439c54b78e89d9869792a (patch)
treeb36c621fec56e04c3cc35ad66dfbd0dda74d1a7b /hash.c
parente716c5ab86802042ffd746efbdeee69da81310f6 (diff)
downloadruby-490979c719f51bea44b439c54b78e89d9869792a.tar.gz
hash.c: exception examples
* hash.c (rb_hash_dig): [DOC] add examples of exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 81a5e6b024..7759332a0b 100644
--- a/hash.c
+++ b/hash.c
@@ -2702,6 +2702,8 @@ rb_hash_any_p(VALUE hash)
*
* g = { foo: [10, 11, 12] }
* g.dig(:foo, 1) #=> 11
+ * g.dig(:foo, 1, 0) #=> TypeError: Fixnum does not have #dig method
+ * g.dig(:foo, :bar) #=> TypeError: no implicit conversion of Symbol into Integer
*/
VALUE