Advent of Code 2020: Day 12 (Ruby solution)