Here's part of my code, the first part of the ˚ statement works, but I would like a separate message to appear for a non-numerical input such as "$boo
", "ten
", "idk
").
puts "Candy Sold: "
candy_sold = gets.chomp.to_i
until candy_sold >= 0
if candy_sold < 0
puts "Please enter a positive number:"
candy_sold = gets.chomp.to_i
elsif candy_sold.class == String # This is where the issue is
puts "Please enter a positive number:"
candy_sold = gets.chomp.to_i
end
end