Skip to content

Instantly share code, notes, and snippets.

@chef
Created June 17, 2009 19:13
Show Gist options
  • Save chef/131430 to your computer and use it in GitHub Desktop.
Save chef/131430 to your computer and use it in GitHub Desktop.
irb(main):003:0> a = { :one => { :foo => "bar", :baz => "snag" } }
=> {:one=>{:baz=>"snag", :foo=>"bar"}}
irb(main):004:0> b = { :one => { :baz => "snarf", :smurf => "aroonie" } }
=> {:one=>{:baz=>"snarf", :smurf=>"aroonie"}}
irb(main):005:0> Chef::Mixin::DeepMerge.merge(a, b)
=> {"one"=>{"baz"=>"snarf", "foo"=>"bar", "smurf"=>"aroonie"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment