Completed
Push — master ( 72b331...d4b7d2 )
by Steffen
02:14
created

AbstractEntity.__repr__()   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
4
from abc import ABC, abstractmethod
5
6
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