Exemple #1
0
    def __init__(self, pipe: "callable", *extra_pipes, message: str=None):
        self.message = message

        if extra_pipes:
            pipes = reversed((pipe,) + extra_pipes)
            self.pipe = compose(*pipes)
        else:
            self.pipe = pipe
Exemple #2
0
    def __init__(self, pipe: "callable", *extra_pipes, message: str = None):
        self.message = message

        if extra_pipes:
            pipes = reversed((pipe, ) + extra_pipes)
            self.pipe = compose(*pipes)
        else:
            self.pipe = pipe
Exemple #3
0
 def validate(self, data: object) -> object:
     validator = compose(*[condition.validate for condition in self.conditions])
     return validator(data)
Exemple #4
0
 def validate(self, data: object) -> object:
     validator = compose(
         *[condition.validate for condition in self.conditions])
     return validator(data)