I’ve been going through the enumerable/enumerator methods that I’m
unfamiliar with and came across each_cons. Apart from a post by a guy
who wasn’t sure where it was even defined, I have only come across one
use of it in the wild:
(points << points).each_cons(2) do |p1,p2|
Does anyone have any ideas on other cases where each_cons would be
useful? Or perhaps insight into why it’s in Ruby?