class MarvelMovies::CLI

Public Instance Methods

call() click to toggle source
# File lib/marvel_movies/cli.rb, line 3
def call
  list_choices
  menu
end
goodbye() click to toggle source
# File lib/marvel_movies/cli.rb, line 45
def goodbye
  puts ""
  puts "Goodbye and check back later for more Marvel Universe"
  exit
end
list_choices() click to toggle source
# File lib/marvel_movies/cli.rb, line 8
  def list_choices
    puts "Hello Marvel Fans"
    puts <<-DOC.gsub /^\s*/, ''
    1. Show All Marvel Movies
    2. Show Upcoming Marvel Movies
    3. Show Marvel Movies Available Now on DVD
    DOC
  end
menu() click to toggle source
movie_description_menu(array) click to toggle source
# File lib/marvel_movies/cli.rb, line 51
def movie_description_menu(array)
  input = nil

  while input != "exit"
    puts " "
    puts "Choose the number of the movie you would like more information on, type back to go back to previous menu, or exit: "
    input = gets.strip.downcase

    if input.to_i > 0
      movie = MarvelMovies::Movie.find_movie(array, input.to_i)
      movie.profile_scrape
      puts "Title: #{movie.title}"
      puts "Release Date: #{movie.release_date}"
      puts "Rating: #{movie.rating}"
      puts "Description: #{movie.description}"
      puts ""
    elsif input == "back"
      call
    elsif input == "exit"
      goodbye
    end
  end
end