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

AbstractEntity.value()   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1.0156

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
cc 1
nop 1
crap 1.0156
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