Well, I haven't found a clean solution to write this code easily in Ruby:
# Java style version:
array.each do |i, el|
if i < array.length - 1
process(array[i], array[i+1])
end
end
# Would be nice if I could do something like this:
array.each do |i, el, next|
process(el, next)
end