title: How to pick uniq hash value with one more condition
body: <p>I have:</p>
  
  <pre><code>h = [{:a=&gt;"Hello", :b=&gt;false}, {:a=&gt;"Hello", :b=&gt;true}, {:a=&gt;"H1", :b=&gt;false}]
  </code></pre>
  
  <p>I want to get unique values based on key <code>a</code>, and the value of <code>b</code> should be <code>true</code>. I want this result:</p>
  
  <pre><code>[{:a=&gt;"Hello", :b=&gt;true}, {:a=&gt;"H1", :b=&gt;false}]
  </code></pre>
  
  <p>If I do:</p>
  
  <pre><code>h.uniq {|hash| hash.values_at(:a)}
  </code></pre>
  
  <p>this will fetch the first uniq hash. I get:</p>
  
  <pre><code>[{:a=&gt;"Hello", :b=&gt;false}, {:a=&gt;"H1", :b=&gt;false}]
  </code></pre>