title: What is a good way to select and take in Ruby?
body: <p>Suppose you have a list of 1,000 items and want to select 10. The condition for select is expensive, but the chance of selecting is high (say 99%).</p>
  
  <pre><code>list.select do |item|
    item if is_ok?(item)
  end.take(10)
  </code></pre>
  
  <p>This code is very inefficient because it checks each item, when it need rarely check more than 10.</p>
  
  <p>What is a better, more efficient and Rubyish way of doing it?</p>