Method: Hash#each_with_parent
- Defined in:
- lib/asana_exception_notifier/initializers/hash.rb
#each_with_parent(parent = nil, &block) ⇒ void
This method returns an undefined value.
This method is used for iterating over a Hash , but besides yielding the key and the value, this will also yield the parent key of the current Hash object if the Hash is associated to a key
28 29 30 31 32 33 34 35 36 |
# File 'lib/asana_exception_notifier/initializers/hash.rb', line 28 def each_with_parent(parent = nil, &block) each do |key, value| if value.is_a?(Hash) deep_hash_with_parent(value, key, &block) elsif block_given? yield(parent, key, value) end end end |