I have a little program accepting user input of multiple integers separated by whitespace, ex: 4 5 6 7
I then push this into an array and want to find the class of each element in the array, which I expect to be a string since I am using the gets command. I am using the .each iterator to do this, but in my code below when I puts output.class I get one output of array instead of four outputs of string.
Can someone point out what I am doing wrong here?
values = []
puts "enter segment values separated by spaces: "
entry = gets.split
values << entry
values.each do |output|
puts output.class
end