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
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
def validate(self, data: object) -> object: validator = compose(*[condition.validate for condition in self.conditions]) return validator(data)
def validate(self, data: object) -> object: validator = compose( *[condition.validate for condition in self.conditions]) return validator(data)