Sha256: fae4204110baaa1a5a043ff16d4a35111799db87b6b641b84793bdbe07dbb792

Contents?: true

Size: 520 Bytes

Versions: 170

Compression:

Stored size: 520 Bytes

Contents

module Puppet::Util::CollectionMerger
  def ar_hash_merge(db_hash, mem_hash, args)
    (db_hash.keys | mem_hash.keys).each do |key|
      if (db_hash[key] && mem_hash[key])
        # in both, update value
        args[:modify].call(db_hash[key], mem_hash[key])
      elsif (db_hash[key])
        # in db, not memory, delete from database
        args[:delete].call(db_hash[key])
      else
        # in mem, not in db, insert into the database
        args[:create].call(key, mem_hash[key])
      end
    end
  end
end

Version data entries

170 entries across 170 versions & 5 rubygems

Version Path
puppet-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/collection_merger.rb
puppet-3.8.7 lib/puppet/util/rails/collection_merger.rb
puppet-3.8.7-x86-mingw32 lib/puppet/util/rails/collection_merger.rb
puppet-3.8.7-x64-mingw32 lib/puppet/util/rails/collection_merger.rb
puppet-3.8.6 lib/puppet/util/rails/collection_merger.rb
puppet-3.8.6-x86-mingw32 lib/puppet/util/rails/collection_merger.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/collection_merger.rb
puppet-3.8.6-x64-mingw32 lib/puppet/util/rails/collection_merger.rb
puppet-retrospec-0.12.0 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/collection_merger.rb
puppet-3.8.5 lib/puppet/util/rails/collection_merger.rb
puppet-3.8.5-x86-mingw32 lib/puppet/util/rails/collection_merger.rb
puppet-3.8.5-x64-mingw32 lib/puppet/util/rails/collection_merger.rb
puppet-3.8.4 lib/puppet/util/rails/collection_merger.rb
puppet-3.8.4-x86-mingw32 lib/puppet/util/rails/collection_merger.rb
puppet-3.8.4-x64-mingw32 lib/puppet/util/rails/collection_merger.rb
puppet-retrospec-0.11.0 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/collection_merger.rb
puppet-retrospec-0.10.0 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/collection_merger.rb
puppet-retrospec-0.9.1 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/collection_merger.rb
puppet-retrospec-0.9.0 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/collection_merger.rb
puppet-retrospec-0.8.1 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/collection_merger.rb