NAME

Syccess::ValidatorSimple - Syccess validator

VERSION

version 0.008

SYNOPSIS

package MyValidators::Custom;

use Moo;

with qw(
  Syccess::ValidatorSimple
);

sub validator {
  my ( $self, $value ) = @_;
  return if $value eq 'ok';
  return 'Your value for %s is not ok.';
}

sub missing_ok { 1 }
sub undef_ok { 1 }
sub empty_ok { 1 }

1;

DESCRIPTION

Please first see Syccess::Validator. This role is a wrapper around it, which requires a function validator, which will be called with the value given on the parameters for the field where the validator is used. By default, it ignores a not existing value, an undefined value or an empty string. You can override this behaviour by overloading the functions missing_ok, undef_ok or empty_ok with a sub that returns a false value. Then this specific case will still be dispatched to the validator function and can then there produce an error, or not ;).

SUPPORT

IRC

Join #sycontent on irc.perl.org. Highlight Getty for fast reaction :).

Repository

http://github.com/SyContent/Syccess
Pull request and additional contributors are welcome

Issue Tracker

http://github.com/SyContent/Syccess/issues

AUTHOR

Torsten Raudssus <torsten@raudss.us>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.