lib/movie_helper/cli.rb in movie_helper-0.1.0 vs lib/movie_helper/cli.rb in movie_helper-0.2.0

- old
+ new

@@ -15,26 +15,29 @@ def list_options puts "Let us help you find a movie!" puts "" puts "Please select an option below:" puts "1. Random" - puts "2. Best Films" - puts "3. Latest Suggestions" - puts "4. Exit" + puts "2. Latest on Netflix" + puts "3. Latest on Amazon" + puts "4. Latest Elsewhere" + puts "5. Exit" selector end def selector input = gets.chomp case input when "1" random when "2" - best_films + latest_netflix when "3" - latest_suggestions - when "4" || "exit" || "quit" + latest_amazon + when "4" + latest_elsewhere + when "5" || "exit" || "quit" else puts "Invalid request." puts "" list_options end @@ -50,26 +53,54 @@ puts movie.title puts "" more_info(movie) end - def best_films + def latest_netflix + if MovieHelper::Movie.latest_netflix.empty? + puts "Loading..." + latest_netflix_films = MovieHelper::Scraper.latest_netflix + MovieHelper::Movie.create_from_list(latest_netflix_films) + puts "" + end + puts "Here are our latest Netflix films:" + movies = MovieHelper::Movie.latest_netflix + movies.each.with_index do |movie, i| + puts "#{i+1}. #{movie.title}" + end + information(movies) + end - if MovieHelper::Movie.best_films.empty? + def latest_amazon + if MovieHelper::Movie.latest_amazon.empty? puts "Loading..." - best_films = MovieHelper::Scraper.best_films - MovieHelper::Movie.create_from_list(best_films) + latest_amazon_films = MovieHelper::Scraper.latest_amazon + MovieHelper::Movie.create_from_list(latest_amazon_films) puts "" end - puts "Here is a list of our best films:" - movies = MovieHelper::Movie.best_films + puts "Here are our latest Amazon films:" + movies = MovieHelper::Movie.latest_amazon movies.each.with_index do |movie, i| puts "#{i+1}. #{movie.title}" end information(movies) end + def latest_elsewhere + if MovieHelper::Movie.latest_elsewhere.empty? + puts "Loading..." + latest_elsewhere_films = MovieHelper::Scraper.latest_elsewhere + MovieHelper::Movie.create_from_list(latest_elsewhere_films) + puts "" + end + puts "Here are our latest films:" + movies = MovieHelper::Movie.latest_elsewhere + movies.each.with_index do |movie, i| + puts "#{i+1}. #{movie.title}" + end + information(movies) + end def information(movies) puts "" puts "For more information on one of these movies, please type 1 - #{movies.count}." puts "To return to the main menu, please type 'list'" @@ -83,24 +114,11 @@ else information(movies) end end - def latest_suggestions - if MovieHelper::Movie.latest.empty? - puts "Loading..." - latest_films = MovieHelper::Scraper.latest - MovieHelper::Movie.create_from_list(latest_films) - puts "" - end - puts "Here are some of our latest suggestions:" - movies = MovieHelper::Movie.latest - movies.each.with_index do |movie, i| - puts "#{i+1}. #{movie.title}" - end - information(movies) - end + def more_info(movie) puts "Would you like more information about this movie?" puts "Type Y to get more information, or list to go back to the main menu." input = gets.chomp @@ -113,15 +131,14 @@ end end def display(movie) puts "Title: #{movie.title} (#{movie.year})" - puts "Watch with #{movie.watch_with}" - puts "Watch when #{movie.watch_when}" + puts "Summary: #{movie.summary}" puts "Genre: #{movie.genre}" - puts "Selected review: #{movie.review}" - puts "Movie stars: #{movie.stars}" - puts "Movie rating: #{movie.rating}" + puts "Mood: #{movie.mood}" + puts "Movie actors: #{movie.actors}" + puts "Movie director: #{movie.director}" puts "Language: #{movie.language}" end def satisfaction_check input = nil