Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/setting.rb
Instance Method Summary collapse
Instance Method Details
#recursive_merge!(other) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/setting.rb', line 8 def recursive_merge!(other) other.keys.each do |k| if self[k].is_a?(Array) && other[k].is_a?(Array) self[k] = other[k] elsif self[k].is_a?(Hash) && other[k].is_a?(Hash) self[k].recursive_merge!(other[k]) else self[k] = other[k] end end self end |