-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestaurant.py
More file actions
65 lines (51 loc) · 1.87 KB
/
restaurant.py
File metadata and controls
65 lines (51 loc) · 1.87 KB
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
"""
This will be used to keep track of certian restruant data to be displayed in Flask. The
Restraunt object will make it much easier to only pass into Flask the information we want
rather than the entire dictionary which is passed obtained from yelp.
@author: Felix Estrella and Jackson Goth
"""
class Restaurant(object):
# Constructor to the Restaurant which will set everything to the empty string.
# Parameters can be assigned as well
def __init__(self, name = '', phone = '', price = '', url = '', location = ''):
self.name = name
self.phone = phone
self.price = price
self.url = url
self.location = location
# Will check for equality by name and location
def __eq__(self, other):
return other != None and self.name == other.name and self.location == other.location
# Will return a string of name and phone
def __str__(self):
return self.name + ": " + self.phone
# Will set the name, given the name parameter
def set_name(self, name):
self.name = name
# Returns the name
def get_name(self):
return self.name
# Will set the phone, given the phone parameter
def set_phone(self, phone):
self.phone = phone
# Returns the phone numbers
def get_phone(self):
return self.phone
# Will set the price, given the price parameter
def set_price(self, price):
self.price = price
# Returns the price
def get_price(self):
return self.price
# Will set the url, given the url parameter
def set_url(self, url):
self.url = url
# Returns the url
def get_url(self):
return self.url
# Will set the location, given the location parameter
def set_location(self, location):
self.location = location
# Returns the location
def get_location(self):
return self.location