Steven Haryanto > Data-Schema-0.136 > Data::Schema::Type::Comparable

Download:
Data-Schema-0.136.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.136   Source  

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.

syntax highlighting: