Exercism accumulator in Ruby