From: sawadatsuyoshi@... Date: 2019-05-09T06:43:27+00:00 Subject: [ruby-core:92607] [Ruby trunk Feature#13123] NilClass#dig Issue #13123 has been updated by sawa (Tsuyoshi Sawada). I am convinced by shyouhei's comment. Please close this feature request. ---------------------------------------- Feature #13123: NilClass#dig https://bugs.ruby-lang.org/issues/13123#change-77966 * Author: sawa (Tsuyoshi Sawada) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- We now have `Hash#dig`. We often have a variable that is either a hash or nil but we are not sure which. In such cases, it would be convenient if we can apply `dig` without conditioning on whether it is a hash or nil. ```ruby h = {a: 1} h.dig(:a) # => 1 h = nil h.dig(:a) # => nil ``` -- https://bugs.ruby-lang.org/ Unsubscribe: