class AirQualityIndex::CLI
Public Instance Methods
call()
click to toggle source
instantiates a new CLI
instance for the program
# File lib/air_quality_index/cli.rb, line 4 def call puts '' puts "Welcome to Air Quality Index (AQI) Grabber" puts '' self.list_options self.menu end
list_options()
click to toggle source
lists menu options for user to select from
# File lib/air_quality_index/cli.rb, line 16 def list_options puts <<-DOC.gsub /^\s*/, '' 1. Local AQI Information 2. Top 5 Nationwide AQI Rankings 3. General AQI Information DOC end
return_message()
click to toggle source
return message displayed after each menu selection call
# File lib/air_quality_index/cli.rb, line 70 def return_message puts "Type 'return' to go back to previous menu, or type 'exit'." puts "" end
time_check()
click to toggle source
check to see if current time is between midnight and 4am EST (Data Unavailable During This Time)
# File lib/air_quality_index/cli.rb, line 76 def time_check time = Time.now.getlocal('-04:00') time.hour.between?(0,4) end