summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorNick Kelley <nick@nickkelley.dev>2021-04-30 15:12:34 -0700
committerJeremy Evans <code@jeremyevans.net>2021-04-30 15:46:19 -0700
commita9824a3113ee5342e7ac90387de9f3b9d5ec9e0a (patch)
treefc8c6b2418bc3d543f1b070467b3a54c7112405f /hash.c
parent1f255adda93bd7958afc7405026326f630ba4748 (diff)
downloadruby-a9824a3113ee5342e7ac90387de9f3b9d5ec9e0a.tar.gz
Correct documentation example on Hash#dig
Fixes [Misc #17842]. The current documentation suggests that: {foo: {bar: {baz: 2}}}.dig(:foo, :bar) # => {:bar=>{:baz=>2}} when it should be: {foo: {bar: {baz: 2}}}.dig(:foo, :bar) # => {:baz=>2}
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index a36310209b..000e816781 100644
--- a/hash.c
+++ b/hash.c
@@ -4555,7 +4555,7 @@ rb_hash_any_p(int argc, VALUE *argv, VALUE hash)
* Nested Hashes:
* h = {foo: {bar: {baz: 2}}}
* h.dig(:foo) # => {:bar=>{:baz=>2}}
- * h.dig(:foo, :bar) # => {:bar=>{:baz=>2}}
+ * h.dig(:foo, :bar) # => {:baz=>2}
* h.dig(:foo, :bar, :baz) # => 2
* h.dig(:foo, :bar, :BAZ) # => nil
*