-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibraryObjects.py
More file actions
40 lines (27 loc) · 865 Bytes
/
LibraryObjects.py
File metadata and controls
40 lines (27 loc) · 865 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
class LibraryItem():
def __init__(self, id, type, title, checkedIn=True):
self.id = id
self.type = type
self.title = title
self.checkedIn = checkedIn
def checkedOutItem(self):
self.checkedIn = False
def checkedInItem(self):
self.checkedIn = True
class Book(LibraryItem):
def __init__(self, id, title, author):
super().__init__(id, "Book", title)
self.author = author
class Map(LibraryItem):
def __init__(self, id, title, age):
super().__init__(id, "Map", title)
self.age = age
class NewsPaper(LibraryItem):
def __init__(self, id, title, date):
super().__init__(id, "NewsPaper", title)
self.age = date
class Person:
def __init__(self, id, fName, sName):
self.id = id
self.fName = fName
self.sName = sName