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

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::Sortable - Role for sortable types

VERSION ^

version 0.136

SYNOPSIS ^

    use Data::Schema;

DESCRIPTION ^

This is the sortable role. It provides attributes like less_than (lt), greater_than (gt), etc. It is used by many types, for example 'str', all numeric types, etc.

Role consumer must provide method '_compare' which takes two values and returns -1, 0, or 1 a la Perl's standard cmp operator.

TYPE ATTRIBUTES ^

min => MIN

Aliases: ge

Require that the value is not less than some specified minimum.

minex => MIN

Aliases: gt

Require that the value is not less or equal than some specified minimum.

max => MAX

Aliases: le

Require that the value is less or equal than some specified maximum.

maxex => MAX

Aliases: lt

Require that the value is less than some specified maximum.

between => [MIN, MAX]

A convenient attribut to combine min and max.

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: