add ruby solution to q018