15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/top_free_apps_itunes/cli.rb', line 15
def
puts ""
puts "Please enter the number of the app to view its details or 'exit' to end the program:"
input = gets.chomp
if input.to_i > 0 && input.to_i <=App.all.size
app = App.all[input.to_i - 1]
Scraper.scrape_app_details(app)
puts ""
puts "#{app.title}"
puts "Category: #{app.category}"
puts "Developer: #{app.developer}"
puts "Rating: #{app.rating}"
puts "Languages: #{app.language}"
puts "Size: #{app.size}"
elsif input == "exit"
puts""
puts "Thank you and goodbye!"
puts ""
exit
else
puts ""
puts "Invalid choice... please select again"
end
end
|