Completed
Push — master ( 7f328c...e44757 )
by Steffen
03:00
created

AbstractEntity.__repr__()   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 6
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nop 1
crap 2
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