17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/landmarks/cli.rb', line 17
def start
puts "Please enter the number of the landmark you would like more information on:"
input = gets.chomp.to_i
if input.between?(1, 20)
landmark = Landmarks::Landmark.find(input)
puts "\t\n"
puts landmark.name.strip.upcase
puts "\t\n"
puts "\t\t\t\t\t\t================== Description of the Landmark =================="
puts "\t\n"
puts landmark.description
puts "\t\n"
puts "\t\t\t\t\t\t================================================================="
puts "\t\n"
puts "Would you like to check the availability of directions, contact information and business hours? y/n"
answer = gets.chomp.downcase
if answer == "y"
puts "\t\n"
puts "\t\t\t\t\t\t====== Directions, contact information and business hours ======"
puts "\t\n"
puts landmark.directions
puts "\t\n"
puts "\t\t\t\t\t\t================================================================="
puts "\t\n"
puts "Would you like to find out more about another landmark? y/n"
response = gets.chomp.downcase
if response == "y"
start
else
puts "\t\n"
puts "Thank you for your interest! Have a great day, and welcome again in the future!"
puts "\t\n"
puts "\t\t\t**************************"
puts "\t\n"
end
else
puts "\t\n"
puts "Would you like to find out more about another landmark? y/n"
response = gets.chomp.downcase
if response == "y"
start
else
puts "Thank you for your interest! Have a great day, and welcome again in the future!"
puts "\t\n"
puts "\t\t\t**************************"
puts "\t\n"
end
end
else
puts "Please enter a number from 1 to 20!"
start
end
end
|