Module: Hashie::Extensions::DeepFind

### Home Classes Methods

### In Files

- lib/hashie/extensions/deep_find.rb

### Methods

- #deep_detect
- #deep_find
- #deep_find_all
- #deep_select

### Class/Module Index

Quicksearch

- Hashie
- Hashie::Clash
- Hashie::Clash::ChainError
- Hashie::CoercionError
- Hashie::Dash
- Hashie::Extensions
- Hashie::Extensions::Coercion
- Hashie::Extensions::Coercion::ClassMethods
- Hashie::Extensions::Coercion::InstanceMethods
- Hashie::Extensions::Dash
- Hashie::Extensions::Dash::IndifferentAccess
- Hashie::Extensions::Dash::IndifferentAccess::ClassMethods
- Hashie::Extensions::DeepFetch
- Hashie::Extensions::DeepFetch::UndefinedPathError
- Hashie::Extensions::DeepFind
- Hashie::Extensions::DeepMerge
- Hashie::Extensions::IgnoreUndeclared
- Hashie::Extensions::IndifferentAccess
- Hashie::Extensions::KeyConversion
- Hashie::Extensions::Mash
- Hashie::Extensions::Mash::SafeAssignment
- Hashie::Extensions::MergeInitializer
- Hashie::Extensions::MethodAccess
- Hashie::Extensions::MethodAccessWithOverride
- Hashie::Extensions::MethodOverridingWriter
- Hashie::Extensions::MethodQuery
- Hashie::Extensions::MethodReader
- Hashie::Extensions::MethodWriter
- Hashie::Extensions::Parsers
- Hashie::Extensions::Parsers::YamlErbParser
- Hashie::Extensions::PrettyInspect
- Hashie::Extensions::StringifyKeys
- Hashie::Extensions::StringifyKeys::ClassMethods
- Hashie::Extensions::SymbolizeKeys
- Hashie::Extensions::SymbolizeKeys::ClassMethods
- Hashie::Hash
- Hashie::Mash
- Hashie::Rash
- Hashie::Trash

No matching classes.

# Hashie::Extensions::DeepFind

### Public Instance Methods

deep_detect(key) click to toggle source
Alias for: deep_find
deep_find(key) click to toggle source

Performs a depth-first search on deeply nested data structures for a key and returns the first occurrence of the key.

    options = {user: {location: {address: '123 Street'}}}
    options.deep_find(:address) # => '123 Street'

    # File lib/hashie/extensions/deep_find.rb, line 9
    def deep_find(key)
      _deep_find(key)
    end

Also aliased as: deep_detect
deep_find_all(key) click to toggle source

Performs a depth-first search on deeply nested data structures for a key and returns all occurrences of the key.

    options = {users: [{location: {address: '123 Street'}}, {location: {address: '234 Street'}}]}
    options.deep_find_all(:address) # => ['123 Street', '234 Street']

    # File lib/hashie/extensions/deep_find.rb, line 20
    def deep_find_all(key)
      matches = _deep_find_all(key)
      matches.empty? ? nil : matches
    end

Also aliased as: deep_select
deep_select(key) click to toggle source
Alias for: deep_find_all

[Validate]

Generated with the Darkfish Rdoc Generator 2.