title: Selecting a specific metafield for a product using Shopify API, Ruby on Rails
body: <p>In liquid templates this is achieved like so:</p>
  
  <pre><code>{{ product.metafields.book.author }}
  </code></pre>
  
  <p>Which returns the value of 'author' for it's key 'book' </p>
  
  <p>I'm using Shopify API and Ruby on Rails and have successfully looped over each metafield for a given product:</p>
  
  <p><strong>In the controller:</strong></p>
  
  <pre><code>@products = ShopifyAPI::Product.find(:all, :params =&gt; {:limit =&gt; 10})
  </code></pre>
  
  <p><strong>In the view:</strong></p>
  
  <pre><code>&lt;% @products.metafields.each do |metafield| %&gt;
  &lt;%= metafield.key %&gt; : &lt;%= metafield.value %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>This returns all of the metafields for a product, as expected. How do I return only those metafields matching a specific key i.e. 'book' from the example above?</p>