Is there a single, easy method in Ruby that will let me read multiple
numbers from the screen directly into multiple variables?
For instance, say I have two variable called “age” and “weight”, and
query the user to enter them on the same line. In FORTRAN I’d just say
READ(,) age, weight
and when the user enters “20, 200” they are put to age and weight, as
real variables. Can I do a similar thing in Ruby?
I did create a method that will parse the string read by “gets” into
elements of an array, but there must be a simpler way to do this that I
am missing.