Sha256: 98b91e106ea3134d1de76b11c061553c3e50e7b3967c04cc5a6890b86862776c

Contents?: true

Size: 291 Bytes

Versions: 26

Compression:

Stored size: 291 Bytes

Contents

module WithDeepMerge
  def deep_merge(base_object, other_object)
    if base_object.is_a?(Hash) && other_object.is_a?(Hash)
      base_object.merge(other_object) { |_, base_value, other_value|
        deep_merge(base_value, other_value)
      }
    else
      other_object
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
govspeak-5.5.0 lib/with_deep_merge.rb
govspeak-5.4.0 lib/with_deep_merge.rb
govspeak-5.3.0 lib/with_deep_merge.rb
govspeak-5.2.2 lib/with_deep_merge.rb
govspeak-5.2.1 lib/with_deep_merge.rb
govspeak-5.2.0 lib/with_deep_merge.rb
govspeak-5.1.0 lib/with_deep_merge.rb
govspeak-5.0.3 lib/with_deep_merge.rb
govspeak-5.0.2 lib/with_deep_merge.rb
govspeak-5.0.1 lib/with_deep_merge.rb
govspeak-5.0.0 lib/with_deep_merge.rb
govspeak-4.0.0 lib/with_deep_merge.rb
govspeak-3.6.2 lib/with_deep_merge.rb
govspeak-3.6.1 lib/with_deep_merge.rb
govspeak-3.6.0 lib/with_deep_merge.rb
govspeak-3.5.2 lib/with_deep_merge.rb
govspeak-3.5.1 lib/with_deep_merge.rb
govspeak-3.5.0 lib/with_deep_merge.rb
govspeak-3.4.0 lib/with_deep_merge.rb
govspeak-3.3.0 lib/with_deep_merge.rb