Method: Vagrant::Config::Top#merge

Defined in:
lib/vagrant/config/top.rb

#merge(other) ⇒ Object

Custom implementation to merge each key separately.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/vagrant/config/top.rb', line 34

def merge(other)
  result = self.class.new
  @keys.each do |key, value|
    result.keys[key] = value.merge(other.send(key))
  end

  other.keys.each do |key, value|
    if !@keys.has_key?(key)
      # This is a key that the other configuration class has
      # that we don't, so just copy it in.
      result.keys[key] = value.dup
    end
  end

  result
end