From: nick@... Date: 2021-04-30T22:30:25+00:00 Subject: [ruby-core:103677] [Ruby master Misc#17842] Example incorrect in documentation for Hash#dig Issue #17842 has been reported by nickkelley (Nick Kelley). ---------------------------------------- Misc #17842: Example incorrect in documentation for Hash#dig https://bugs.ruby-lang.org/issues/17842 * Author: nickkelley (Nick Kelley) * Status: Open * Priority: Normal * Assignee: nickkelley (Nick Kelley) ---------------------------------------- In the current examples for Hash#dig, we have: ``` h = {foo: {bar: {baz: 2}}} h.dig(:foo) # => {:bar=>{:baz=>2}} h.dig(:foo, :bar) # => {:bar=>{:baz=>2}} <-- incorrect return value ``` This should be: ``` h = {foo: {bar: {baz: 2}}} h.dig(:foo) # => {:bar=>{:baz=>2}} h.dig(:foo, :bar) # => {:baz=>2} ``` I have a pull request incoming to fix this on GitHub, but I can create a patch and post it here if that is better. Documentation link for reference: https://ruby-doc.org/core-3.0.1/Hash.html#method-i-dig -- https://bugs.ruby-lang.org/ Unsubscribe: