title: Add something to hash value if key exists?
body: <p>I have a Hash in Ruby:</p>
  
  <pre><code>hash = Hash.new
  </code></pre>
  
  <p>It has some key value pairs in it, say:</p>
  
  <pre><code>hash[1] = "One"
  hash[2] = "Two"
  </code></pre>
  
  <p>If the hash contains a key <code>2</code>, then I want to add "Bananas" to its value. If the hash doesn't have a key <code>2</code>, I want to create a new key value pair <code>2=&gt;"Bananas"</code>.</p>
  
  <p>I know I can do this by first checkng whether the hash has the key <code>2</code> by using <code>has_key?</code> and then act accordingly. But this requires an <code>if</code> statement and more than one line.</p>
  
  <p>So is there a simple, elegant one-liner for achieving this?</p>