Skip to content

Commit 7b4d58b

Browse files
committed
Apply aggregate to the Coordinates class
making the latitude and longitude into protected, because there is no point making them public
1 parent 1c7e4ae commit 7b4d58b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/coordinates.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class Coordinates:
77
"""
88

99
def __init__(self, latitude, longitude):
10-
self.latitude = latitude
11-
self.longitude = longitude
10+
self._latitude = latitude
11+
self._longitude = longitude
1212

1313
def serialize(self):
1414
"""
@@ -17,7 +17,7 @@ def serialize(self):
1717
:returns: The serialized coordinates.
1818
:rtype: dict
1919
"""
20-
return {"latitude": self.latitude, "longitude": self.longitude}
20+
return {"latitude": self._latitude, "longitude": self._longitude}
2121

2222
def __str__(self):
23-
return "lat: %s, long: %s" % (self.latitude, self.longitude)
23+
return "lat: %s, long: %s" % (self._latitude, self._longitude)

0 commit comments

Comments
 (0)