Data::Schema::Type::All - Type handler for 'all' type
version 0.136
use Data::Schema;
'All' is not really an actual data type, but a way to validate whether a value validates to all of the specified schemas. 'And' is another name for this type.
Example schema (in YAML syntax):
- all - schemas: - [int, {divisible_by: 2}] - [int, {divisible_by: 7}]
Example valid data:
42 # divisible by 2 as well as 7
Example invalid data:
21 # divisible by 7 but not by 2 4 # divisible by 2 but not by 7 15 # not divisible by 2 nor 7
All is Scalar, so you might want to consult the docs of those roles to see what type attributes are available.
Specify the schema(s), where the value will need to be valid to all of them.
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2009 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Schema, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Schema
CPAN shell
perl -MCPAN -e shell install Data::Schema
For more information on module installation, please visit the detailed CPAN module installation guide.