title: How can I filter an array of hashes to get only the keys in another array?
body: <p>I'm trying get a subset of keys for each hash in an array. </p>
  
  <p>The hashes are actually much larger, but I figured this is easier to understand:</p>
  
  <pre><code>[
    {
      id:2,
      start: "3:30",
      break: 30,
      num_attendees: 14
    },
    {
      id: 3,
      start: "3: 40",
      break: 40,
      num_attendees: 4
    },
    {
      id: 4,
      start: "4: 40",
      break: 10,
      num_attendees: 40
    }
  ]
  </code></pre>
  
  <p>I want to get only the <code>id</code> and <code>start</code> values.</p>
  
  <p>I've tried:</p>
  
  <pre><code>return_keys = ['id','start']
  return_array = events.select{|key,val|  key.to_s.in? return_keys}
  </code></pre>
  
  <p>but this returns an empty array. </p>