7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/top_100_movies/cli.rb', line 7
def start
puts "******************************************************"
puts "****** WELCOME TO TOP 100 MOVIES! ******"
puts "******************************************************"
list_movies
puts ""
puts ""
puts "Type 'exit' to exit the program"
puts "Please enter the number of the movie you'd like to know more about"
puts ""
input = gets.chomp
if input.to_i > 0 && input.to_i <= 100
movie = Top100Movies::Movie.find(input.to_i)
Top100Movies::Movie.print_movie(movie)
puts ""
print "Would you like to checkout another movie? (y/n): "
repeat = gets.chomp
if repeat.downcase == 'y'
start
else
puts "Goodbye!"
exit
end
elsif input == "exit"
puts "Goodbye!!"
exit
else
puts "Wrong input"
start
end
end
|