Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1afcd9

Browse files
author
quokka_chen
committed
Fix lost function in abstract_factory
1 parent 295c36c commit e1afcd9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

abstract_factory.py

+6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,18 @@ class DogFactory:
5252
def get_pet(self):
5353
return Dog()
5454

55+
def get_food(self):
56+
return "dog food"
57+
5558

5659
class CatFactory:
5760

5861
def get_pet(self):
5962
return Cat()
6063

64+
def get_food(self):
65+
return "cat food"
66+
6167
# Create the proper family
6268
def get_factory():
6369
"""Let's be dynamic!"""

0 commit comments

Comments
 (0)