lib/hashie/extensions/deep_find.rb
def _deep_find_all(key, object = self, matches = [])
        deep_locate_result = DeepLocate.deep_locate(key, object).tap do |result|
          result.map! { |element| element[key] }
        end

        matches.concat(deep_locate_result)
      end
# 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.extend(Hashie::Extensions::DeepFind)
#  options.deep_find(:address) # => '123 Street'
#
#  class MyHash < Hash
#    include Hashie::Extensions::DeepFind
#  end
#
#  my_hash = MyHash.new
#  my_hash[:user] = {location: {address: '123 Street'}}
#  my_hash.deep_find(:address) # => '123 Street'
Performs a depth-first search on deeply nested data structures for
a key and returns the first occurrence of the key.



class MyHash < Hash
include Hashie::Extensions::DeepFind
end


Performs a depth - first search on deeply nested data structures for a key and returns the first occurrence of the key . class MyHash < Hash include Hashie :: Extensions :: DeepFind end
def _deep_find_all(key, object = self, matches = [])
        deep_locate_result = DeepLocate.deep_locate(key, object).tap do |result|
          result.map! { |element| element[key] }
        end
        matches.concat(deep_locate_result)
      end
def _deep_find_all ( key , object = self , matches = [ ] ) deep_locate_result = DeepLocate . deep_locate ( key , object ) . tap do | result | result . map! { | element | element [ key ] } end matches . concat ( deep_locate_result ) end
Performs a depth-first search on deeply nested data structures for
a key and returns the first occurrence of the key.
Performs a depth - first search on deeply nested data structures for a key and returns the first occurrence of the key .
key
object
matches