#controls our initiate_cli

class Top25TravelDestinations::CLI

  def call
    puts "Discover the top 25 travel destinations according to TripAdvisor!"

    while @input != "exit"
    Destination.list_destinations
    puts "Type the number next to the city that you would like more information on, or type 'exit'"
    @input = gets.chomp 
    choose_destination 
    Destination.destination_information(@input)
    end
    goodbye
  end


  def goodbye
    puts "See you later for more destinations!"
    exit
  end 

  def choose_destination
    if @input == "exit"
      goodbye
    elsif !@input.to_i.between?(1,25) 
      puts "Incorrect input, try again"
      @input = gets.chomp.to_i
    end
  end

end #ends Class