Sha256: 66df22278ea048644110d7ac81ebeae6449cfb98a7403e0deccab998fc858ccd

Contents?: true

Size: 543 Bytes

Versions: 1

Compression:

Stored size: 543 Bytes

Contents

module Vagrant
  module Util
    module DeepMerge
      # This was lifted straight from Rails 4.0.2 as a basic Hash
      # deep merge.
      def self.deep_merge(myself, other_hash, &block)
        myself = myself.dup
        other_hash.each_pair do |k,v|
          tv = myself[k]
          if tv.is_a?(Hash) && v.is_a?(Hash)
            myself[k] = deep_merge(tv, v, &block)
          else
            myself[k] = block && tv ? block.call(k, tv, v) : v
          end
        end
        myself
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/bundler/gems/vagrant-c84e05fd063f/lib/vagrant/util/deep_merge.rb