aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-27 18:07:11 +0000
committerstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-27 18:07:11 +0000
commitc81188ef6c8eac11da4cdcbdcea789b40fc541ff (patch)
treef954383437a5c1a4a00a6ab81fb5263fbd15a2fd /hash.c
parent777d52280cd3d95c9f0efa5b503c7d4acbb4dd4e (diff)
downloadruby-c81188ef6c8eac11da4cdcbdcea789b40fc541ff.tar.gz
Fix doc for Hash#dig and Struct#dig
* hash.c (rb_hash_dig): [DOC] correct argument name in method description; fix formatting in examples. * struct.c (rb_struct_dig): ditto. [ruby-core:79221] [Bug #13148] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hash.c b/hash.c
index 4b76d0282f..3b2b6c61ca 100644
--- a/hash.c
+++ b/hash.c
@@ -2862,19 +2862,19 @@ rb_hash_any_p(VALUE hash)
* call-seq:
* hsh.dig(key, ...) -> object
*
- * Extracts the nested value specified by the sequence of <i>idx</i>
+ * Extracts the nested value specified by the sequence of <i>key</i>
* objects by calling +dig+ at each step, returning +nil+ if any
* intermediate step is +nil+.
*
* h = { foo: {bar: {baz: 1}}}
*
- * h.dig(:foo, :bar, :baz) #=> 1
- * h.dig(:foo, :zot, :xyz) #=> nil
+ * h.dig(:foo, :bar, :baz) #=> 1
+ * h.dig(:foo, :zot, :xyz) #=> nil
*
* g = { foo: [10, 11, 12] }
- * g.dig(:foo, 1) #=> 11
- * g.dig(:foo, 1, 0) #=> TypeError: Integer does not have #dig method
- * g.dig(:foo, :bar) #=> TypeError: no implicit conversion of Symbol into Integer
+ * g.dig(:foo, 1) #=> 11
+ * g.dig(:foo, 1, 0) #=> TypeError: Integer does not have #dig method
+ * g.dig(:foo, :bar) #=> TypeError: no implicit conversion of Symbol into Integer
*/
VALUE