# File lib/weather_by_dcq/view.rb, line 9defmenuputs''puts'Please enter a city to retrieve a forecast (Format: City State):'input_location = gets.striplocation = input_location.gsub(/[\W\d]/, '').downcaseputs"You entered: #{location}".colorize(:blue) +' Is this correct (Y/N)?'input_confirm = gets.strip.downcaseifinput_confirm=='n'puts'I am sorry, let us try again.'menuelsifinput_confirm=='y'system('cls') ||system('clear')
puts''puts"Current Conditions for #{location}:".colorize(:blue)
puts'====================================='WeatherByDcq::Forecast.display_curr_table(location)
# Extended forecast Listputs'Extended forecast:'.colorize(:blue)
puts'--------------------'WeatherByDcq::Forecast.display_forecast_listputs''options_menuelsebeginraiseWeatherErrorrescueWeatherError=>eputse.messageendmenuendend
options_menu()click to toggle source
# File lib/weather_by_dcq/view.rb, line 43defoptions_menuputs''puts'Would you like additional details about any of the days listed?'.colorize(:blue)
puts'Please enter the corresponding number for your request, or any letter to EXIT: '.colorize(:blue)
detail_input = gets.strip.to_iifdetail_input.positive?&&detail_input<9system('cls') ||system('clear')
WeatherByDcq::Forecast.display_details(detail_input)
options_menuelsifdetail_input.negative?||detail_input>8beginraiseWeatherErrorrescueWeatherError=>eputse.messageendoptions_menuelseexitendend