Validator::Lazy::Role::Check::MinMax
Version 0.03
use Validator::Lazy; my $v = Validator::Lazy->new( { minmax => { MinMax => { min => 2, max => 4, type => 'Str' } } } ); my $v = Validator::Lazy->new( { minmax => { MinMax => [ $min, $max, $type ] } } ); my $ok = $v->check( minmax => 'xxxxx' ); # ok is false say Dumper $v->errors; # [ { code => 'TOO_BIG', field => 'minmax', data => { min => 2, max => 4 } } ]
An internal Role for Validator::Lazy, part of Validator::Lazy package. Provides "MinMax" type for Validator::Lazy config. Allows to check value for predefined range (from-to-valuetype).
check
Called from inside if Validator::Lazy->check process Temporary overrides internal Validator::Lazy::check method like this: $validator->check( $value, $param ); $param - is a list = [ minvalue, maxvalue, valuetype ] OR $param - is a hash = { min => minvalue, max => maxvalue, type => Str or Int ] $value - your value to check
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/
ANTONC <antonc@cpan.org>
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>
To install Validator::Lazy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Validator::Lazy
CPAN shell
perl -MCPAN -e shell install Validator::Lazy
For more information on module installation, please visit the detailed CPAN module installation guide.