-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfactory.py
More file actions
117 lines (83 loc) · 2.42 KB
/
Copy pathfactory.py
File metadata and controls
117 lines (83 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
from dataclasses import dataclass
from enums import CoffeeMakers
from interface import CoffeeMaker
@dataclass
class Aeropress(CoffeeMaker):
def brew(self):
super().brew(make='Aeropress')
@dataclass
class AutoDripMachine(CoffeeMaker):
def brew(self):
super().brew(make='AutoDripMachine')
@dataclass
class Chemex(CoffeeMaker):
def brew(self):
super().brew(make='Chemex')
@dataclass
class Clever(CoffeeMaker):
def brew(self):
super().brew(make='Clever')
@dataclass
class CoffeeBag(CoffeeMaker):
def brew(self):
super().brew(make='CoffeeBag')
@dataclass
class ColdDrip(CoffeeMaker):
def brew(self):
super().brew(make='ColdDrip')
@dataclass
class Cowboy(CoffeeMaker):
def brew(self):
super().brew(make='Cowboy')
@dataclass
class Espresso(CoffeeMaker):
def brew(self):
super().brew(make='Espresso')
@dataclass
class FrenchPress(CoffeeMaker):
def brew(self):
super().brew(make='FrenchPress')
@dataclass
class Ibrik(CoffeeMaker):
def brew(self):
super().brew(make='Ibrik')
@dataclass
class Moka(CoffeeMaker):
def brew(self):
super().brew(make='Moka')
@dataclass
class Percolator(CoffeeMaker):
def brew(self):
super().brew(make='Percolator')
@dataclass
class Siphon(CoffeeMaker):
def brew(self):
super().brew(make='Siphon')
@dataclass
class SoftBrew(CoffeeMaker):
def brew(self):
super().brew(make='SoftBrew')
@dataclass
class VietnameseDripFilter(CoffeeMaker):
def brew(self):
super().brew(make='VietnameseDripFilter')
class CoffeMakerFactory:
def get_maker(self, coffee_maker: CoffeeMaker):
list_of_makers = {
CoffeeMakers.Aeropress: Aeropress,
CoffeeMakers.AutoDripMachine: AutoDripMachine,
CoffeeMakers.Chemex: Chemex,
CoffeeMakers.Clever: Clever,
CoffeeMakers.CoffeeBag: CoffeeBag,
CoffeeMakers.ColdDrip: ColdDrip,
CoffeeMakers.Cowboy: Cowboy,
CoffeeMakers.Espresso: Espresso,
CoffeeMakers.FrenchPress: FrenchPress,
CoffeeMakers.Ibrik: Ibrik,
CoffeeMakers.Moka: Moka,
CoffeeMakers.Percolator: Percolator,
CoffeeMakers.Siphon: Siphon,
CoffeeMakers.SoftBrew: SoftBrew,
CoffeeMakers.VietnameseDripFilter: VietnameseDripFilter,
}
return list_of_makers.get(coffee_maker)