Skip to content

Commit a5fd545

Browse files
adding docstrings
1 parent d4c35dd commit a5fd545

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

Creational/AbstractFactory/abstract_factory_pattern.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ class ComputerEquipmentInterface(ABC):
1010
@property
1111
@abstractmethod
1212
def name(self) -> str:
13-
pass
13+
"""Getter for the property 'name'"""
1414

1515
@abstractmethod
1616
def turn_on(self):
17-
pass
17+
"""Define functionality for turning on the instance of a computer."""
1818

1919
@abstractmethod
2020
def turn_off(self):
21-
pass
21+
"""Define functionality for turning of the instance of a computer."""
2222

2323

2424
class MonitorEquipmentInterface(ABC):
@@ -27,15 +27,15 @@ class MonitorEquipmentInterface(ABC):
2727
@property
2828
@abstractmethod
2929
def name(self) -> str:
30-
pass
30+
"""Getter for the property 'name'"""
3131

3232
@abstractmethod
3333
def turn_on(self):
34-
pass
34+
"""Define functionality for turning on the instance of a monitor."""
3535

3636
@abstractmethod
3737
def turn_off(self):
38-
pass
38+
"""Define functionality for turning off the instance of a monitor."""
3939

4040

4141
class WebcamEquipmentInterface(ABC):
@@ -44,15 +44,15 @@ class WebcamEquipmentInterface(ABC):
4444
@property
4545
@abstractmethod
4646
def name(self) -> str:
47-
pass
47+
"""Getter for the property 'name'"""
4848

4949
@abstractmethod
5050
def turn_on(self):
51-
pass
51+
"""Define functionality for turning on the instance of a webcam."""
5252

5353
@abstractmethod
5454
def turn_off(self):
55-
pass
55+
"""Define functionality for turning off the instance of a webcam."""
5656

5757

5858
class MacMini(ComputerEquipmentInterface):
@@ -154,19 +154,19 @@ class EquipmentFactoryInterface(ABC):
154154
@property
155155
@abstractmethod
156156
def employee_equipment_type(self):
157-
pass
157+
"""A property that defines what class of equipment an employee can get."""
158158

159159
@abstractmethod
160160
def define_monitor(self) -> MonitorEquipmentInterface:
161-
pass
161+
"""Create an instance that represents a monitor."""
162162

163163
@abstractmethod
164164
def define_webcam(self) -> WebcamEquipmentInterface:
165-
pass
165+
"""Create an instance that represents a webcam."""
166166

167167
@abstractmethod
168168
def define_computer(self) -> ComputerEquipmentInterface:
169-
pass
169+
"""Create an instance that represents a computer."""
170170

171171

172172
class RemoteEquipmentFactory(EquipmentFactoryInterface):
@@ -178,7 +178,7 @@ def define_monitor(self):
178178

179179
def define_computer(self):
180180
return MacbookAir()
181-
181+
182182
def define_webcam(self):
183183
return Webcam1080p()
184184

@@ -190,10 +190,10 @@ class OnsiteEquipmentFactory(EquipmentFactoryInterface):
190190

191191
def define_monitor(self):
192192
return DualMonitors()
193-
193+
194194
def define_computer(self):
195195
return MacMini()
196-
196+
197197
def define_webcam(self):
198198
return Webcam1080p()
199199

@@ -205,10 +205,10 @@ class ExecutiveEquipmentFactory(EquipmentFactoryInterface):
205205

206206
def define_monitor(self):
207207
return DualMonitors()
208-
208+
209209
def define_computer(self):
210210
return MacMini()
211-
211+
212212
def define_webcam(self):
213213
return Webcam1080p()
214214

@@ -220,10 +220,10 @@ class ContractorEquipmentFactory(EquipmentFactoryInterface):
220220

221221
def define_monitor(self):
222222
return Monitor4k()
223-
223+
224224
def define_computer(self):
225225
return MacMini()
226-
226+
227227
def define_webcam(self):
228228
return Webcam1080p()
229229

0 commit comments

Comments
 (0)