Total Complexity | 3 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | #!/usr/bin/python |
||
7 | class AbstractEntity(ABC): |
||
8 | """Abstract Entity abstract class""" |
||
9 | |||
10 | def __repr__(self): |
||
11 | """Return only the values we set before |
||
12 | |||
13 | :return: |
||
14 | """ |
||
15 | return str(self.value) |
||
16 | |||
17 | @property |
||
18 | def __dict__(self): |
||
19 | """Needed for JSON encoding the objects |
||
20 | |||
21 | :return: |
||
22 | """ |
||
23 | return self.value |
||
24 | |||
25 | @property |
||
26 | @abstractmethod |
||
27 | def value(self): |
||
28 | """Returning all values we actually want to have in the model |
||
29 | |||
30 | :return: |
||
31 | """ |
||
32 | pass |
||
33 |