Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/openstudio/helpers/hash.rb

Overview

******************************************************************************* OpenStudio®, Copyright © Alliance for Sustainable Energy, LLC. See also openstudio.net/license *******************************************************************************

Instance Method Summary collapse

Instance Method Details

#deep_find(key) ⇒ Object



7
8
9
# File 'lib/openstudio/helpers/hash.rb', line 7

def deep_find(key)
  key?(key) ? self[key] : values.reduce(nil) { |memo, v| memo ||= v.deep_find(key) if v.respond_to?(:deep_find) }
end