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}
This commit is contained in:
parent
1f255adda9
commit
a9824a3113
Notes:
git
2021-05-01 07:46:46 +09:00
2
hash.c
2
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
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user