forked from unorjikingsley/Catalog-of-my-things
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.rb
72 lines (66 loc) · 1.29 KB
/
app.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
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
require_relative 'classes/movie/movie'
require_relative 'classes/movie/source'
require_relative 'classes/book/book'
require_relative 'classes/book/label'
require_relative 'classes/music/music_album'
require_relative 'classes/music/genre'
require_relative 'classes/games/game'
require_relative 'classes/games/author'
require_relative 'modules/modules'
class App
attr_accessor :movies, :books, :label
include Modules
def initialize
@movies = []
@sources = []
@books = []
@label = []
@genres = []
@music_albums = []
@games = []
@authors = []
load_collections
end
def run_till6(option)
case option
when 1
display_books
when 2
display_all_music_albums
when 3
display_all_movies
when 4
display_all_games
when 5
display_all_genres
when 6
display_labels
else
puts 'Thank you for using this app!'
save_and_exit
end
end
def run_more_than6(option)
case option
when 7
display_all_authors
when 8
display_all_sources
when 9
add_book
when 10
add_music
when 11
add_movie
when 12
add_game
else
puts 'Thank you for using this app!'
save_and_exit
end
end
def save_and_exit
save_collections
exit
end
end