search for matching key-value pair in an array of hashes and return true if match found
<p>Suppose I have this array of hashes:</p>

<pre><code>[ {"nutrient"=&gt;"protein", "value"=&gt;12, "calories"=&gt;48, "unit"=&gt;"g"},
  {"nutrient"=&gt;"fat", "value"=&gt;5, "calories"=&gt;45, "unit"=&gt;"g"},
  {"nutrient"=&gt;"fibre", "value"=&gt;1, "calories"=&gt;nil, "unit"=&gt;"g"},
  {"nutrient"=&gt;"carbohydrates", "value"=&gt;67, "calories"=&gt;268, "unit"=&gt;"g"},
  {"nutrient"=&gt;"calcium", "value"=&gt;42, "calories"=&gt;nil, "unit"=&gt;"mg"}]
</code></pre>

<p>How can I return boolean true if (nutrient value is equal to 'carbohydrates' and it's calories are equal to 268 ) and (if nutrient value is equal to 'protein' and it's calories are equal to 48)</p>

<p>That is, in short I want to return true for above array of hash.</p>