title: Ruby: What is the easiest method to update Hash values?
body: <p>Say:</p>
  
  <pre><code>h = { 1 =&gt; 10, 2 =&gt; 20, 5 =&gt; 70, 8 =&gt; 90, 4 =&gt; 34 }
  </code></pre>
  
  <p>I would like to change each value <code>v</code> to <code>foo(v</code>), such that <code>h</code> will be:</p>
  
  <pre><code>h = { 1 =&gt; foo(10), 2 =&gt; foo(20), 5 =&gt; foo(70), 8 =&gt; foo(90), 4 =&gt; foo(34) }
  </code></pre>
  
  <p>What is the most elegant way to achieve this ?</p>