NAME
Validator::Lazy::Role::Check
VERSION
Version 0.01
SYNOPSIS
use Validator::Lazy;
my $v = Validator::Lazy->new( $config );
my $ok = $v->check( $hashref_of_your_data_to_chech ); # true / false
OR
my ( $ok, $data ) = $v->check( $hashref_of_your_data_to_chech ); # true / false
say Dumper $v->errors; # [ { code => any_error_code, field => field_with_error, data => { variable data for more accurate error definition } } ]
say Dumper $v->warnings; # [ { code => any_warn_code, field => field_with_warn, data => { variable data for more accurate warn definition } } ]
say Dumper $v->data; # Fixed data. For example trimmed strings, corrected char case, etc...
DESCRIPTION
Provides "Check" role for Validator::Lazy, part of Validator::Lazy package.
Contains checking loop during $validator->check call.
Each check iteration will try to execute for each field-class of each field in your_data_hashref sequence of: Your::Role::before Your::Role::check Your::Role::after
Your::Role::before - should be used for precheck, or modification
of form param value. For example you can do trimlr here
Your::Role::check - main functional of called role.
The form value shoild be checked here
and result should be mirrired im validator object
Your::Role::after - After the value is checked,
Role may want to prepare value for something.
For example the role can convert data into internal format,
store checked file to disc or something like that.
METHODS
check
$validator->check( $your_data_hashref );
SUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the perldoc command.
perldoc Validator::Lazy
You can also look for information at:
RT, CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Validator-Lazy
AnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/Validator-Lazy
CPAN Ratings
http://cpanratings.perl.org/d/Validator-Lazy
Search CPAN
http://search.cpan.org/dist/Validator-Lazy/
AUTHOR
ANTONC <antonc@cpan.org>
LICENSE
This program is free software; you can redistribute it and/or modify it
under the terms of the the Artistic License (2.0). You may obtain a
copy of the full license at:
L<http://www.perlfoundation.org/artistic_license_2_0>
check
$validator->check( $your_data_hashref );