Ruby: Exercise in converting different units of time