Flowdock
method

dig

Importance_1
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActiveSupport::HashWithIndifferentAccess
dig(*args) public

Same as Hash#dig where the key passed as argument can be either a string or a symbol:

counters = ActiveSupport::HashWithIndifferentAccess.new
counters[:foo] = { bar: 1 }

counters.dig('foo', 'bar')     # => 1
counters.dig(:foo, :bar)       # => 1
counters.dig(:zoo)             # => nil
Show source
Register or log in to add new notes.