Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_sync.rb

Overview

TODO: Fixed in ruby 1.9.x ???

Instance Method Summary collapse

Instance Method Details

#deep_merge!(other_hash) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/i18n_sync.rb', line 12

def deep_merge!(other_hash)
  other_hash.each do |k,v|
    next unless tv = self[k]
    self[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? tv.dup.deep_merge!(v) : v
  end
  self
end