Ruby: A script to convert string to integer and integer to string