Module: Displayable::InstanceMethods

Included in:
PHLCovidTesting::CLI, PHLCovidTesting::TestingLocation
Defined in:
lib/concerns/Displayable.rb

Instance Method Summary collapse

Instance Method Details

#display_allObject



3
4
5
6
7
8
# File 'lib/concerns/Displayable.rb', line 3

def display_all
    PHLCovidTesting::TestingLocation.all.each.with_index(1) {|x, i| puts "\n#{i}. #{x.name}"}
    all_sites = PHLCovidTesting::TestingLocation.all
    puts "\nEnter a number to learn more about a testing location, 'main' to return to the main menu, or 'exit' to end the program.\n".colorize(:yellow)
    get_input_all(all_sites)
end

#display_detail(result) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/concerns/Displayable.rb', line 10

def display_detail(result)
    puts "\n------------------------------------------------------------------------------------------"
    puts "Name:".colorize(:blue) + " #{result.name}"
    puts "Address:".colorize(:blue) + " #{result.address}" unless result.address == nil
    puts "Phone Number:".colorize(:blue) + " #{result.phone}" unless result.phone == nil
    puts "Access Type:".colorize(:blue) + " #{result.access_type}" unless result.access_type == nil
    puts "Facility Type:".colorize(:blue) + " #{result.facility_type}" unless result.facility_type == nil
    puts "Referral Needed?".colorize(:blue) + " #{result.referral}" unless result.referral == nil
    puts "------------------------------------------------------------------------------------------\n"
end