The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

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, ...]

Require that the data is one of the specified choices.

Synonyms: is_one_of

not_one_of => [value1, ...]

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

Synonyms: isnt_one_of

is => value

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

is => value

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

isnt => value

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

Synonyms: not

AUTHOR

Steven Haryanto, <steven at masterweb.net>

COPYRIGHT & LICENSE

Copyright 2009 Steven Haryanto, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.