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