Class: Chef::Mixin::DeepMerge

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/mixin/deep_merge.rb

Class Method Summary collapse

Class Method Details

.merge(first, second) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/chef/mixin/deep_merge.rb', line 23

def self.merge(first, second)
  first = Mash.new(first).to_hash unless second.kind_of?(Mash)
  first = first.to_hash
  second = Mash.new(second).to_hash unless second.kind_of?(Mash)
  second = second.to_hash

  Mash.new(first.ko_deep_merge!(second, {:knockout_prefix => '!merge:'}))
end