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

NAME

Data::Schema::Type::Comparable - Role for comparable types

VERSION

version 0.136

SYNOPSIS

    use Data::Schema;

DESCRIPTION

This is the comparable role. It provides attributes like is, one_of, etc. It is used by most types, for example 'str', all numeric types, etc.

Role consumer must provide method '_equal' which takes two values and returns 0 or 1 depending on whether the values are equal.

TYPE ATTRIBUTES

one_of => [value1, ...]

Aliases: is_one_of

Require that the data is one of the specified choices.

not_one_of => [value1, ...]

Aliases: isnt_one_of

Require that the data is not listed in one of the specified "blacklists".

is => value

A convenient attribute for one_of when there is only one choice.

isnt => value

Aliases: not

A convenient attribute for not_one_of when there is only one item in the blacklist.

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.