lib/worldcup/cli.rb
# Output of run method depends on what the input is from a user,
# It will select the right path to desired info,
# It will display of options at every step,
# It will loop back to itself when input is invalid,
# The app will exit , when the input is "exit".
Output of run method depends on what the input is from a user,
It will select the right path to desired info,
It will display of options at every step,
It will loop back to itself when input is invalid,
The app will exit , when the input is "exit".
Output of run method depends on what the input is from a user It will select the right path to desired info It will display of options at every step It will loop back to itself when input is invalid The app will exit when the input is " exit " .
def run
			puts ""
			puts ""
			puts ""
			next_option
			puts ""
			puts "What would like to see next?"
			puts ""
			input = gets.strip.downcase
		if input == "teams"
	        puts teams
	        run
	    elsif input == "players"
	    	puts "'Let's get name of 32 teams first"
  		    puts teams
  		    puts "Let's pick a number to see details"
			new_team_number = gets.strip.to_i
  			player_print(new_team_number)
  			run
	    elsif input == "facts"
	  		Worldcup::Team.tournament_facts
	  		run
  		elsif input == "groups"
  			puts "Enter 'list' for list of groups or 'detail' for detils of every group"
  			group_input = gets.strip.downcase
  			group_with_teams(group_input)
	  		run
	  elsif input == "exit"	
 	 		puts "See you in FIFA WorldCup 2022 Qatar,  Good Bye..."
		else
			puts "Invalid entry, try again"
			run
 			end
		end
def run puts "" puts "" puts "" next_option puts "" puts "What would like to see next?" puts "" input = gets . strip . downcase if input == "teams" puts teams run elsif input == "players" puts "'Let's get name of 32 teams first" puts teams puts "Let's pick a number to see details" new_team_number = gets . strip . to_i player_print ( new_team_number ) run elsif input == "facts" Worldcup :: Team . tournament_facts run elsif input == "groups" puts "Enter 'list' for list of groups or 'detail' for detils of every group" group_input = gets . strip . downcase group_with_teams ( group_input ) run elsif input == "exit" puts "See you in FIFA WorldCup 2022 Qatar,  Good Bye..." else puts "Invalid entry, try again" run end end
Output of run method depends on what the input is from a user,
It will select the right path to desired info,
It will display of options at every step,
It will loop back to itself when input is invalid,
The app will exit , when the input is "exit".
Output of run method depends on what the input is from a user It will select the right path to desired info It will display of options at every step It will loop back to itself when input is invalid The app will exit when the input is " exit " .