Total Complexity | 3 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Coverage | 100% |
1 | """Converter classes.""" |
||
12 | 1 | class Converter(metaclass=ABCMeta): |
|
13 | """Base class for attribute converters.""" |
||
14 | |||
15 | 1 | @abstractclassmethod |
|
16 | def create_default(cls): |
||
17 | """Create a default value for an attribute.""" |
||
18 | 1 | raise NotImplementedError(common.OVERRIDE_MESSAGE) |
|
19 | |||
20 | 1 | @abstractclassmethod |
|
21 | def to_value(cls, data): |
||
22 | """Convert loaded data to an attribute's value.""" |
||
23 | 1 | raise NotImplementedError(common.OVERRIDE_MESSAGE) |
|
24 | |||
25 | 1 | @abstractclassmethod |
|
26 | def to_data(cls, value): |
||
27 | """Convert an attribute to data optimized for dumping.""" |
||
28 | 1 | raise NotImplementedError(common.OVERRIDE_MESSAGE) |
|
29 | |||
52 |