-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.rb
49 lines (41 loc) · 1002 Bytes
/
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
require_relative 'book'
require_relative 'person'
require_relative 'teacher'
require_relative 'student'
require_relative 'rental'
require_relative 'console'
require_relative 'books_list'
require_relative 'rentals_list'
require_relative 'people_list'
class App
def initialize
puts "Welcome to School Library App!\n\n"
@my_ui = Console.new
@books_list = BooksList.new(@my_ui)
@people_list = PeopleList.new(@my_ui)
@rentals_list = RentalsList.new(@my_ui, @books_list, @people_list)
end
def list_all_books
@books_list.list_all_books
end
def create_book
@books_list.create_book
end
def list_rentals_for_person_id
@rentals_list.list_rentals_for_person_id
end
def create_rental
@rentals_list.create_rental
end
def create_person
@people_list.create_person
end
def list_all_people
@people_list.list_all_people
end
def save_all_data
@books_list.save_books
@people_list.save_people
@rentals_list.save_rentals
end
end