Passed
Push — master ( c24a70...6ad542 )
by P.R.
11:00
created

SimpleCondition.expression()   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 1
dl 8
loc 8
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1 1
import abc
2
3 1
from etlt.condition.Condition import Condition
4
5
6 1 View Code Duplication
class SimpleCondition(Condition):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7
    """
8
    A simple condition matches a single field in the row against an expression.
9
    """
10
11
    # ------------------------------------------------------------------------------------------------------------------
12 1
    def __init__(self, field, expression):
13
        """
14
        Object contructor.
15
16
        :param str field: The name of the field in the row that must be match against the expression.
17
        :param str expression: The expression.
18
        """
19 1
        self._field = field
20
        """
21
        The name of the field in the row that must be match against the expression.
22
23
        :type: str
24
        """
25
26 1
        self._expression = expression
27 1
        """
28
        The expression.
29
30
        :type: str
31
        """
32
33
    # ------------------------------------------------------------------------------------------------------------------
34 1
    @property
35 1
    def expression(self):
36
        """
37
        Returns the expression.
38
39
        :rtype: str
40
        """
41 1
        return self._expression
42
43
    # ------------------------------------------------------------------------------------------------------------------
44 1
    @property
45 1
    def field(self):
46
        """
47
        Returns the name of the field in the row that must be match against the expression.
48
49
        :rtype: str
50
        """
51
        return self._field
52
53
    # ------------------------------------------------------------------------------------------------------------------
54 1
    @property
55 1
    @abc.abstractmethod
56 1
    def scheme(self):
57
        """
58
        Returns the scheme of the simple condition.
59
60
        :rtype: str
61
        """
62
        raise NotImplementedError()
63
64
# ----------------------------------------------------------------------------------------------------------------------
65