forked from andrianarivo/catalog_of_my_things
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.rb
More file actions
44 lines (39 loc) Β· 984 Bytes
/
main.rb
File metadata and controls
44 lines (39 loc) Β· 984 Bytes
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
40
41
42
43
44
# MAIN CLASS: does three things
# starts the application
# displays the options
# takes user input
require_relative 'takeinput'
require_relative 'app'
class Main
def initialize
@app = App.new
prompt
end
def prompt
puts 'Welcome to the Catalog of my things App!'
loop do
display_options
option = TakeInput.new.take_input
@app.first_run(option)
break if option == 13
end
end
def display_options
puts 'Please choose one of the options: '
puts '1. - List all books π'
puts '2. - List all music albums πΉ'
puts '3. - List games π²'
puts '4. - List all genres π'
puts '5. - List all labels π·οΈ'
puts '6. - List all authors βπ½'
puts '7. - Create a book'
puts '8. - Create a music album'
puts '9. - Create a game'
puts '10. - Create a genre'
puts '11. - Create a label'
puts '12. - Create a author'
puts '13. - Exit π'
end
end
Main.new
# ruby main.rb