Actually I can’t understand what the cause of my problem is, I start the loop , everything works correctly, a certain list is displayed in the terminal, but as soon as I get it into the method, everything ends there, there are no errors when starting, but there is no list from the cycle loop , tell me where to dig?

An example that works:

 loop do puts "Hello World" break end 

An example of what doesn't work, but needs to be done:

  def menu loop do puts %Q( 1. Посчитать цену молока ) puts "Введите нужное число из меню:" input = gets.chomp case input when 1 show_moloko end end end def show_moloko тут вычисляем end 

Closed due to the fact that off-topic participants D-side , user194374, aleksandr barakin , Alex , Denis Bubnov 8 December '16 at 8:48 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - D-side, Community Spirit, Alex, Denis Bubnov
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • No, well, so it became much better, it was immediately clear what was the matter. - Igor
  • @Igor Dovabil for clarity, a couple of examples. - Denis T. Nov.
  • Do you call the menu function? - Igor
  • @Igor I understand where you're going, no, I don’t call, the loop contains another case with processing methods for accessing one of the menu items, which is enclosed in puts , each menu item of the cycle is a separate processing method. - Denis T. Nov.
  • Hmm, so if the menu not called anywhere, where does the output in the terminal come from? Write menu() where loop used to be. - Igor

0