-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rb
39 lines (33 loc) · 803 Bytes
/
main.rb
1
2
3
4
5
6
7
8
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
require './classes/app'
require './classes/options'
def main
options = Options.new
puts '___________________________________________________________'
puts ''
puts 'WELCOME TO THE SCHOOL LIBRARY APP'
puts '___________________________________________________________'
puts ''
loop do
display_menu
option = gets.chomp
if option == '7'
puts 'Thank you for using this app!'
break
end
options.options(option)
end
end
def display_menu
puts ''
puts 'Please choose an option by entering a number:'
puts '1 - List all books'
puts '2 - List all people'
puts '3 - Create a person'
puts '4 - Create a book'
puts '5 - Create a rental'
puts '6 - List all rentals for a given person id'
puts '7 - Exit'
puts ''
print 'Enter number: '
end
main