class Hash

Public Instance Methods

recursive_merge!(other) click to toggle source
# File lib/setting.rb, line 6
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