Enumerate A Pairing Of Every Two Sequential Items
items = [:a, :b, :c, :d, :z]tuples = [[:a, :b], [:b, :c], [:c, :d], [:d, :z]]items.first(items.size - 1)
# => [:a, :b, :c, :d]
items.last(items.size - 1)
#=> [:b, :c, :d, :z]
items.first(items.size - 1).zip(items.last(items.size - 1))
#=> [[:a, :b], [:b, :c], [:c, :d], [:d, :z]]Last updated