input = " "
until input == ‘quit’
puts "
Menu
(1) Hi!
(2) Credits
(3 or quit) Exit"
input = gets.chomp.to_s
case input
when "1" then
puts "Hi!"
when "2" then
puts "Written By: wally"
when "3" then
input = 'quit'
else
puts "Invalid input"
end
end
=> output
Menu
(1) Hi!
(2) Credits
(3 or quit) Exit
Written By: wally
Menu
(1) Hi!
(2) Credits
(3 or quit) Exit
why this error?
…\Playground:9:in <main>': undefined methodchomp’ for nil:NilClass
(NoMethodError)