We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95b8ea4 commit 73b2c8dCopy full SHA for 73b2c8d
README.md
@@ -575,6 +575,10 @@ Comparison:
575
576
##### `Hash#dig` vs `Hash#[]` vs `Hash#fetch` [code](code/hash/dig-vs-[]-fetch.rb)
577
578
+[Ruby 2.3 introduced `Hash#dig`](http://ruby-doc.org/core-2.3.0/Hash.html#method-i-dig) which is a readable
579
+and performant option for retrieval from a nested hash, returning `nil` if an extraction step fails.
580
+See https://github.com/JuanitoFatas/fast-ruby/pull/102#issuecomment-198827506 for more info.
581
+
582
```
583
$ ruby -v code/hash/dig-vs-\[\]-vs-fetch.rb
584
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
0 commit comments