Method: NestedObjects::Mixin#nested_dig

Defined in:
lib/nested_objects/mixin.rb

#nested_dig(path) ⇒ Object

Retrieves the value at the specified path in the given data

Examples:

data = { 'a' => { 'b' => [1, 2, 3] } }
NestedObjects.dig(data, ['a', 'b', '0']) #=> 1

Raises:

  • (BadPathError)

    if the path is invalid or does not exist



20
# File 'lib/nested_objects/mixin.rb', line 20

def nested_dig(path) = NestedObjects.dig(self, path)