title: Ruby: Count unique elements and their occurences in an array
body: <p>Is there a method in Ruby that takes an array, and counts all unique elements and their occurrences and passes them back as a hash?</p>
  
  <p>For example</p>
  
  <pre><code>  ['A','A','A','A','B','B','C'].method
  &gt; {'A' =&gt; 4, 'B' =&gt; 2, 'C' =&gt; 1}
  </code></pre>
  
  <p>Something like that.</p>