9
10
11
12
13
14
15
16
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
|
# File 'lib/birth_year_album/cli.rb', line 9
def
input = nil
while input != "exit"
input = get_year
if input.to_i > 0 if input.to_i >= 1956 && input.to_i <= 2015 album = find_album(input.to_i)
puts ""
puts "The top album of #{album.year} was:"
puts ""
puts "----------------------------------------------"
puts ""
puts "#{album.name} by #{album.artist}"
puts ""
puts "----------------------------------------------"
puts ""
elsif input.to_i < 1956
puts ""
puts "There are no records of top selling albums before 1956. Try another year."
puts ""
else
puts ""
puts "This is not a valid year. Try again!"
puts ""
end
elsif input == "exit"
puts ""
puts "Thanks! See you next time."
puts ""
else
puts ""
puts "I'm not sure what you are looking for try again."
puts ""
end
end
end
|