mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
4df168074c
commit
b14ea7d05b
1 changed files with 2 additions and 0 deletions
2
hash.c
2
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
|
||||
|
|
Loading…
Reference in a new issue