title: How can I reject or allow only certain keys in a Hash?
body: <p>I have this method that tries to select out certain field from each hashie::mash object (each image is a hashie::mash object) but not all of them.</p>
  
  <pre><code>  def images
          images = object.story.get_spree_product.master.images
          images.map do |image|
            {
              position: image["position"],
              attachment_file_name: image["attachment_file_name"],
              attachment_content_type: image["attachment_content_type"],
              type: image["type"],
              attachment_width: image["attachment_width"],
              attachment_height: image["attachment_height"],
              attachment_updated_at: image["attachment_updated_at"],
              mini_url: image["mini_url"],
              small_url: image["small_url"],
              product_url: image["product_url"],
              large_url: image["large_url"],
              xlarge_url: image["xlarge_url"]
            }
          end
        end
  </code></pre>
  
  <p>Is there an easier way to do this?</p>
  
  <p>images is an array of hashie::mash objects.</p>
  
  <pre><code>object.story.get_spree_product.master.images.first.class
  Hashie::Mash &lt; Hashie::Hash
  [15] pry(#&lt;Api::V20150315::RecipeToolSerializer&gt;)&gt; object.story.get_spree_product.master.images.count
  2
  </code></pre>