-
-
15 Jul 2012 13:33:29 UTC
- Distribution: Data-TreeValidator
- Module version: 0.04
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (582 / 0 / 24)
- Kwalitee
Bus factor: 0- 87.50% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (20.71KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Data::TreeValidator::Constraints - A collection of constraints for validating data
SYNOPSIS
use Data::TreeValidator::Constraints qw( required );
DESCRIPTION
Constraints currently take a single form, a subroutine reference. If the data does not validate, an exception will be raised (which is caught by process methods). If an exception is not raised, the data will be assumed to be valid.
All methods below are available for importing into using modules
FUNCTIONS
required
Checks that $input is defined, and stringifies to a true value (not the empty string)
length min => $min, max => $max
Checks that a given input is between
$min
and$max
. You do not have to specify both parameters, either or is also fine.options @options
Checks that a given input is in the set defined by
@options
.type $type_constraint
Checks that a given input satisfies a given Moose::Meta::TypeConstraint. E.g.
use MooseX::Types::Moose qw/Num/; type(Num);
AUTHOR
Oliver Charles
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Oliver Charles <oliver.g.charles@googlemail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Data::TreeValidator, copy and paste the appropriate command in to your terminal.
cpanm Data::TreeValidator
perl -MCPAN -e shell install Data::TreeValidator
For more information on module installation, please visit the detailed CPAN module installation guide.