| 1 | package Data::Sah::Type::Comparable; | ||
| 2 | |||
| 3 | 65 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 65 | ▶ | use Data::Sah::Util::Role 'has_clause'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 65 | ▶ | use Role::Tiny; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 65 | requires 'superclause_comparable'; | |
| 9 | |||
| 10 | has_clause 'in', | ||
| 11 | v => 2, | ||
| 12 | tags => ['constraint'], | ||
| 13 | schema => ['array', {req=>1, of=>['_same', {req=>1}]}], | ||
| 14 | allow_expr => 1, | ||
| 15 | 2093 | ▶ | code => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 16 | 2093 | my ($self, $cd) = @_; | |
| 17 | 2093 | $self->superclause_comparable('in', $cd); | |
| 18 | 65 | }; | |
| 19 | has_clause 'is', | ||
| 20 | v => 2, | ||
| 21 | tags => ['constraint'], | ||
| 22 | schema => ['_same', {req=>1}], | ||
| 23 | allow_expr => 1, | ||
| 24 | 2223 | ▶ | code => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 25 | 2223 | my ($self, $cd) = @_; | |
| 26 | 2223 | $self->superclause_comparable('is', $cd); | |
| 27 | 65 | }; | |
| 28 | |||
| 29 | 65 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 30 | 65 | our $DATE = '2024-02-16'; # DATE | |
| 31 | 65 | our $DIST = 'Data-Sah'; # DIST | |
| 32 | 65 | our $VERSION = '0.917'; # VERSION | |
| 33 | |||
| 34 | 65 | 1; | |
| 35 | # ABSTRACT: Comparable type role | ||
| 36 | |||
| 37 | __END__ | ||