title: Odd (or even) entries in a Ruby Array
body: <p>Is there a quick way to get every other entry in an Array in Ruby? Either the odd or even entries values with 0 included in the odd. I'd like to be able to use it like this:</p>
  
  <pre><code>array1 += array2.odd_values
  </code></pre>
  
  <p>or</p>
  
  <pre><code>puts array2.odd_values.join("-")
  </code></pre>
  
  <p>for example</p>
  
  <p><b>Update</b></p>
  
  <p>This give exactly what I'm after but I'm sure there is a shorter version.</p>
  
  <pre><code>array1.each_with_index do |item,index| 
    if (index %2 ==0) then 
      array2.push(item) 
    end
  end
  </code></pre>