Skip to content

Instantly share code, notes, and snippets.

@ml
Created August 14, 2009 10:21
Show Gist options
  • Save ml/167752 to your computer and use it in GitHub Desktop.
Save ml/167752 to your computer and use it in GitHub Desktop.
class Hash
def +(another)
h = self.clone
another.each do |k, v|
if h.has_key? k
h[k] += v
else
h[k] = v
end
end
h
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment