Module: ApiClient::Utils

Defined in:
lib/api_client/utils.rb

Class Method Summary collapse

Class Method Details

.deep_merge(hash, other_hash) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/api_client/utils.rb', line 5

def self.deep_merge(hash, other_hash)
  other_hash.each_pair do |key,v|
    if hash[key].is_a?(::Hash) and v.is_a?(::Hash)
      deep_merge hash[key], v
    else
      hash[key] = v
    end
  end
  hash
end