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

Lines changed: 6 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy