50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/finder/cli.rb', line 50
def show_list(num)
five = RecipeFinder::Dish.show(num)
print_items(five)
puts "Would you like to see more info about one of these? Enter its number, or no."
more_info = gets.strip
if more_info != "no"
index = more_info.to_i
specific_item = RecipeFinder::Dish.find(index)
RecipeFinder::Scraper.new.more_info(specific_item)
print_item(specific_item)
next_action = gets.strip
if next_action == "exit"
ending
else
show_list(num)
end
else
if (num == "first")
puts "Wants to see more search results? Enter yes or no."
more_results = gets.strip
if more_results != "no"
show_list("next")
else
repeat_end
end
else
repeat_end
end
end
end
|