Sha256: 36583015397ca9efd79aaa1721963a2d7da322d61171ba9e7de3c9b6d8182cbf

Contents?: true

Size: 960 Bytes

Versions: 463

Compression:

Stored size: 960 Bytes

Contents

require 'deep_merge/core'

module DeepMerge
  module DeepMergeHash
    # ko_hash_merge! will merge and knockout elements prefixed with DEFAULT_FIELD_KNOCKOUT_PREFIX
    def ko_deep_merge!(source, options = {})
      default_opts = {:knockout_prefix => "--", :preserve_unmergeables => false}
      DeepMerge::deep_merge!(source, self, default_opts.merge(options))
    end

    # deep_merge! will merge and overwrite any unmergeables in destination hash
    def deep_merge!(source, options = {})
      default_opts = {:preserve_unmergeables => false}
      DeepMerge::deep_merge!(source, self, default_opts.merge(options))
    end

    # deep_merge will merge and skip any unmergeables in destination hash
    def deep_merge(source, options = {})
      default_opts = {:preserve_unmergeables => true}
      DeepMerge::deep_merge!(source, self, default_opts.merge(options))
    end

  end # DeepMergeHashExt
end

class Hash
  include DeepMerge::DeepMergeHash
end

Version data entries

463 entries across 463 versions & 7 rubygems

Version Path
deep_merge-1.2.2 lib/deep_merge/deep_merge_hash.rb
puppet-5.5.22 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.22-x86-mingw32 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.22-x64-mingw32 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.22-universal-darwin lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.21 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.21-x86-mingw32 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.21-x64-mingw32 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.21-universal-darwin lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.20 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.20-x86-mingw32 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.20-x64-mingw32 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.20-universal-darwin lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.19 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.19-x86-mingw32 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.19-x64-mingw32 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.19-universal-darwin lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.18 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-5.5.18-x86-mingw32 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
puppet-6.4.5 lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb