Skip to content

Instantly share code, notes, and snippets.

@mdkent
Created January 11, 2010 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdkent/274454 to your computer and use it in GitHub Desktop.
Save mdkent/274454 to your computer and use it in GitHub Desktop.
irb(main):001:0> a = { :x => true }; b = { :x => false }; p a.deep_merge!(b, {:merge_debug => true})
Source class: Hash :: Dest class: Hash
Hashes: {:x=>false} :: {:x=>true}
looping: :x => false :: {:x=>true}
==>merging: :x => false :: true
Returning {:x=>true}
{:x=>true}
=> nil
irb(main):001:0> a = { :x => true }; b = { :x => false }; p a.deep_merge!(b, {:merge_debug => true})
Source class: Hash :: Dest class: Hash
Hashes: {:x=>false} :: {:x=>true}
looping: :x => false :: {:x=>true}
==>merging: :x => false :: true
Source class: FalseClass :: Dest class: TrueClass
Others: false :: true
Returning false
Returning {:x=>false}
{:x=>false}
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment