title: Iterate over a array and returning the next and the element before current
body: <p>How may i fetch next and before current element from array while iterating array with each.</p>
  
  <pre><code>array.each do |a|
     # I want to fetch next and before current element.
  end
  </code></pre>