title: In Ruby, some good ways to convert everything in array of hash values from float to int?
body: <p>I have an array of hashes, and the values are all float numbers.</p>
  
  <p>What are some good ways in Ruby to convert them all to int? </p>
  
  <p>I have this way right now but wonder what other methods there are that are more elegant or clear:</p>
  
  <pre><code>analytics.map {|e| e.keys.each {|k| e[k] = e[k].to_i}; e}
  </code></pre>
  
  <p><strong>Update:</strong> this is a run of the code:</p>
  
  <pre><code>&gt; @analytics = [{:a =&gt; 1.1, :b =&gt; 123.456}, {'c' =&gt; 765.432}]
   =&gt; [{:a=&gt;1.1, :b=&gt;123.456}, {"c"=&gt;765.432}] 
  
  &gt; @analytics.map {|e| e.keys.each {|k| e[k] = e[k].to_i}; e} 
   =&gt; [{:a=&gt;1, :b=&gt;123}, {"c"=&gt;765}] 
  
  &gt; @analytics
   =&gt; [{:a=&gt;1, :b=&gt;123}, {"c"=&gt;765}]
  </code></pre>