Sha256: 0e6b2050c8b1a492882824724f93491788fa519457e5411fcc158322e92557ad

Contents?: true

Size: 290 Bytes

Versions: 25

Compression:

Stored size: 290 Bytes

Contents

class Hash
  def deep_merge!(other)
    self.merge!(other) do |_key, v_self, v_other|
      if v_self.is_a?(Hash) && v_other.is_a?(Hash)
        v_self.deep_merge(v_other)
      else
        v_other
      end
    end
  end

  def deep_merge(other)
    self.dup.deep_merge!(other)
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
review-5.10.0 lib/review/extentions/hash.rb
review-5.9.0 lib/review/extentions/hash.rb
review-5.8.0 lib/review/extentions/hash.rb
review-5.7.0 lib/review/extentions/hash.rb
review-5.6.0 lib/review/extentions/hash.rb
review-5.5.0 lib/review/extentions/hash.rb
review-5.4.0 lib/review/extentions/hash.rb
review-5.3.0 lib/review/extentions/hash.rb
review-5.2.0 lib/review/extentions/hash.rb
review-5.1.1 lib/review/extentions/hash.rb
review-5.1.0 lib/review/extentions/hash.rb
review-5.0.0 lib/review/extentions/hash.rb
review-4.2.0 lib/review/extentions/hash.rb
review-4.1.0 lib/review/extentions/hash.rb
review-4.0.0 lib/review/extentions/hash.rb
review-3.2.0 lib/review/extentions/hash.rb
review-3.1.0 lib/review/extentions/hash.rb
review-3.0.0 lib/review/extentions/hash.rb
review-3.0.0.rc1 lib/review/extentions/hash.rb
review-3.0.0.preview4 lib/review/extentions/hash.rb