Sha256: 9b51ce3834147d5a529398386f5f2ddc621cbaa40ee22f6ac9c3c02aa0d078f3

Contents?: true

Size: 589 Bytes

Versions: 26

Compression:

Stored size: 589 Bytes

Contents

module Raven
  module Utils
    # ported from ActiveSupport
    module DeepMergeHash
      def self.deep_merge(hash, other_hash, &block)
        deep_merge!(hash, other_hash, &block)
      end

      def self.deep_merge!(hash, other_hash, &block)
        hash.merge!(other_hash) do |key, this_val, other_val|
          if this_val.is_a?(Hash) && other_val.is_a?(Hash)
            deep_merge(this_val, other_val, &block)
          elsif block_given?
            block.call(key, this_val, other_val)
          else
            other_val
          end
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
sentry-raven-2.7.4 lib/raven/utils/deep_merge.rb
sentry-raven-2.7.3 lib/raven/utils/deep_merge.rb
jones-gem-2.7.2 lib/raven/utils/deep_merge.rb
alec-gem-2.7.2 lib/raven/utils/deep_merge.rb
sentry-raven-2.7.2 lib/raven/utils/deep_merge.rb
sentry-raven-2.7.1 lib/raven/utils/deep_merge.rb