add ruby solution to q031