Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update to coordinates.py to implement creational design pattern
  • Loading branch information
shaynmorgan committed Aug 16, 2021
commit 262fc8d741045eef67a5bfe42aedac70beacc0dc
1 change: 1 addition & 0 deletions app/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class CoordinateFactory:
def create_coordinate(creation_type:int, data:float):
if creation_type == 1: new_coordinate = Latitude(data)
if creation_type == 2: new_coordinate = Longitude(data)
return new_coordinate
class Coordinate:
pass
class Latitude(Coordinate):
Expand Down