title: Ruby array equivalent of active record.where(criteria)
body: <p>This may be a really long stretch but would make life a fair bit easier if it existed.</p>
  
  <p>Heres the scenario any case. I have an array of hashes with one key whos value is another hash........Yeah, I know.</p>
  
  <p>Heres a better explanation:</p>
  
  <pre><code>@myArrayOfStuff[0]
  @myArrayOfStuff[0]["single-key"]
  @myArrayOfStuff[0]["single-key"]["object-identifier"]
  </code></pre>
  
  <p>The first returns a hash.
  The second would return an object (called page in my case but example uses different names)
  The third returns whatever variable I have reference as object-identifier.</p>
  
  <p>Simple enough.</p>
  
  <p>What I'd like to do is pick make another array where object-identifiers value is not nil or is greater than x. Something Similar to the activerecord.where method.</p>
  
  <pre><code>@x = @myArrayOfStuff.where(["single-key"]["object-identifier"]) &gt; 3orwhatever
  </code></pre>
  
  <p>Obviously this doesn't work as the syntax is attrocious. But is there another way of going about it? Another route to try might possibly be to sort the array by this variable. Something like </p>
  
  <pre><code>@x = @myArrayOfStuff.sort {|x,y| y &lt;=&gt; x } 
  </code></pre>
  
  <p>However I dont really understand whats going on with ruby's sort method.
  Can anyone help?</p>