The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Schema::Type::Int - Type handler for integer numbers ('int')

VERSION

version 0.136

SYNOPSIS

 use Data::Schema;

DESCRIPTION

This is the type handler for type 'int'.

TYPE ATTRIBUTES

See Data::Schema::Type::Num.

In addition to those provided by Num, ints have additional attributes.

mod => [X, Y]

Require that (data mod X) equals Y. For example, mod => [2, 1] effectively specifies odd numbers.

divisible_by => INT or ARRAY

Require that data is divisible by all specified numbers.

Example:

 ds_validate( 4, [int=>{divisible_by=>2}]     ); # valid
 ds_validate( 4, [int=>{divisible_by=>[2,3]}] ); # invalid
 ds_validate( 6, [int=>{divisible_by=>[2,3]}] ); # valid

not_divisible_by => INT or ARRAY

Aliases: indivisible_by

Opposite of divisible_by.

AUTHOR

  Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

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.