title: How to act differently on the first iteration in a Ruby loop?
body: <p>I always use a counter to check for the first item (<code>i==0</code>) in a loop:</p>
  
  <pre><code>i = 0
  my_array.each do |item|
    if i==0
      # do something with the first item
    end
    # common stuff
    i += 1
  end
  </code></pre>
  
  <p>Is there a more elegant way to do this (perhaps a method)? </p>