Completed
Push — master ( 00dd46...452f18 )
by P.R.
01:48
created

Condition.match()   A

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
dl 0
loc 10
ccs 1
cts 1
cp 1
crap 1
rs 9.4285
c 1
b 0
f 0
1
"""
2
ETLT
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8 1
import abc
9
10
11 1
class Condition(metaclass=abc.ABCMeta):
12
    """
13
    An abstract parent class for conditions.
14
    """
15
16
    # ------------------------------------------------------------------------------------------------------------------
17 1
    @abc.abstractmethod
18
    def match(self, row):
19
        """
20
        Returns True if the row matches this condition. Returns False otherwise.
21
22
        :param dict row: The row.
23
24
        :rtype: bool
25
        """
26
        raise NotImplementedError()
27
28
# ----------------------------------------------------------------------------------------------------------------------
29