diff options
author | Nick Kelley <[email protected]> | 2021-04-30 15:12:34 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2021-04-30 15:46:19 -0700 |
commit | a9824a3113ee5342e7ac90387de9f3b9d5ec9e0a (patch) | |
tree | fc8c6b2418bc3d543f1b070467b3a54c7112405f /hash.c | |
parent | 1f255adda93bd7958afc7405026326f630ba4748 (diff) |
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}
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4441
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 * |