Module: RubyDig Private

Included in:
Array, Hash
Defined in:
lib/stackify_apm/util/dig.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#dig(key, *rest) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/stackify_apm/util/dig.rb', line 8

def dig(key, *rest)
  value = self[key]

  if value.nil? || rest.empty?
    value
  elsif value.respond_to?(:dig)
    value.dig(*rest)
  else
    raise TypeError, "#{value.class} does not respond to `#dig'"
  end
end