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-3.1.2 lib/raven/utils/deep_merge.rb
sentry-raven-3.1.1 lib/raven/utils/deep_merge.rb
sentry-raven-3.1.0 lib/raven/utils/deep_merge.rb
sentry-raven-3.0.4 lib/raven/utils/deep_merge.rb
sentry-raven-3.0.3 lib/raven/utils/deep_merge.rb
sentry-raven-3.0.2 lib/raven/utils/deep_merge.rb
sentry-raven-3.0.1 lib/raven/utils/deep_merge.rb
sentry-raven-3.0.0 lib/raven/utils/deep_merge.rb
sentry-raven-2.13.0 lib/raven/utils/deep_merge.rb
sentry-raven-2.12.3 lib/raven/utils/deep_merge.rb
sentry-raven-2.12.2 lib/raven/utils/deep_merge.rb
sentry-raven-2.12.1 lib/raven/utils/deep_merge.rb
sentry-raven-2.12.0 lib/raven/utils/deep_merge.rb
sentry-raven-2.11.3 lib/raven/utils/deep_merge.rb
sentry-raven-2.11.2 lib/raven/utils/deep_merge.rb
sentry-raven-2.11.1 lib/raven/utils/deep_merge.rb
sentry-raven-2.11.0 lib/raven/utils/deep_merge.rb
sentry-raven-2.10.0 lib/raven/utils/deep_merge.rb
sentry-raven-2.9.0 lib/raven/utils/deep_merge.rb
sentry-raven-2.8.0 lib/raven/utils/deep_merge.rb