Ruby impl of the code kata