неопределенный метод (NoMethodError) ruby
Я получаю следующее сообщение об ошибке:
text.rb:2:in `': undefined method `choices' for main:Object (NoMethodError)
Но я могу'Кажется, я не понимаю, почему мой метод "неопределенный ":
puts "Select [1] [2] [3] or [q] to quit"; users_choice = gets.chomp
choices(users_choice)
def choices (choice)
while choice != 'q'
case choice
when '1'
puts "you chose one!"
when '2'
puts "you chose two!"
when '3'
puts "you chose three!"
end
end
end