Short analogue of Riffle[] accepting two blocks
There's not too much to say about your implementation, though I'm not sure declaring riffle as a lambda provides any benefit instead of just defining it as a standard function.

Instead of storing the previous element of the iteration and using it to call the block, you should check only call the block if you are not on the last element of the enumerable (if possible, of course, there are some cases when it isn't).

While you can use a mixture of a custom enumerator and a block, it's not the nicest way to do things. I'd recommend instead passing in two lambdas (or a lambda and a block) so that it is immediately clear that the first block follows the second.

def riffle(enumerable, a, b)
  enumerable.each_with_index  do |x, i|
    a.call x
    b.call x unless i + 1 == enumerable.size
  end
end

riffle [1, 2, 3],
  -&gt; i { p [i, :IN] },
  -&gt; i { p [i, :OUT] }


This gives the output:

[1, :IN]
[1, :OUT]
[2, :IN]
[2, :OUT]
[3, :IN]
=&gt; [1, 2, 3]