Thursday, December 13, 2007

class Hash ; def + ...

I don't get why this isn't already a part of Ruby.

An even simpler way to do it:

class Hash ; alias :+ :merge ; end

(The minus sign version might be slightly trickier.)