title: Ruby/RoR - Count occurrence of an element in an array
body: <p>I'v a hash </p>
  
  <p><code>{1=&gt;true, 7=&gt;false, 6=&gt;true, 4=&gt;false}</code> </p>
  
  <p>or an array like </p>
  
  <p><code>[1, true], [7, false], [6, true], [4, false]]</code></p>
  
  <p>or</p>
  
  <p><code>[true, false, true, false]</code>.</p>
  
  <p>How can I find the number of <code>true</code>s in the array?</p>