Say I have a an array like:
a = [1, 2, 3, 4, 5, 6]
and I have two variables like this:
b = 3
c = 4
I want to do something like this:
a.each do |i|
if(b = = i) and (c == i.next(I don't think I can do this))
return true
end
end
Any help would be appreciated.
Steve G.
Don’t use
To get a series of paired objects.
Use each_cons as suggested by steenslag or glenn mcdonald.