Passed
Push — master ( 272d30...b93c80 )
by Steffen
01:01
created

AbstractEntity   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 26
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A value() 0 8 1
A __repr__() 0 6 1
A __dict__() 0 7 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