Sha256: c6e0bfd722ccab1a5423f440784e1abb34b55da8ec8d488a34398fd468ed0d18

Contents?: true

Size: 499 Bytes

Versions: 34

Compression:

Stored size: 499 Bytes

Contents

# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

module HashExtensions
  refine Hash do
    def deep_merge(hash)
      hash = hash.to_hash
      merge(hash) do |_key, old_val, new_val|
        if old_val.is_a?(Hash) && new_val.is_a?(Hash)
          old_val.deep_merge(new_val)
        else
          new_val
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
gooddata-2.0.0-java lib/gooddata/extensions/hash.rb
gooddata-2.0.0 lib/gooddata/extensions/hash.rb
gooddata-1.3.6-java lib/gooddata/extensions/hash.rb
gooddata-1.3.6 lib/gooddata/extensions/hash.rb
gooddata-1.3.5-java lib/gooddata/extensions/hash.rb
gooddata-1.3.5 lib/gooddata/extensions/hash.rb
gooddata-1.3.4-java lib/gooddata/extensions/hash.rb
gooddata-1.3.4 lib/gooddata/extensions/hash.rb
gooddata-1.3.3-java lib/gooddata/extensions/hash.rb
gooddata-1.3.3 lib/gooddata/extensions/hash.rb
gooddata-1.3.2-java lib/gooddata/extensions/hash.rb
gooddata-1.3.2 lib/gooddata/extensions/hash.rb
gooddata-1.3.1-java lib/gooddata/extensions/hash.rb
gooddata-1.3.1 lib/gooddata/extensions/hash.rb