title: Skip over iteration in Enumerable#collect
body: <pre><code>(1..4).collect do |x|
    next if x == 3
    x + 1
  end # =&gt; [2, 3, nil, 5]
      # desired =&gt; [2, 3, 5]
  </code></pre>
  
  <p>If the condition for <code>next</code> is met, <code>collect</code> puts <code>nil</code> in the array, whereas what I'm trying to do is put <em>no</em> element in the returned array if the condition is met. Is this possible without calling <code>delete_if { |x| x == nil }</code> on the returned array?</p>
  
  <p>(Using Ruby 1.8.7; my code excerpt is heavily abstracted)</p>