Skip to content

Instantly share code, notes, and snippets.

@ajmurmann
Created February 16, 2012 17:53
Show Gist options
  • Save ajmurmann/1846720 to your computer and use it in GitHub Desktop.
Save ajmurmann/1846720 to your computer and use it in GitHub Desktop.
merge with block
{:a => 2, :b => 10}.merge(:a =>3) {|key, x, y| x + y}
=> {:a=>5, :b=>10}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment