| 1 | package TUI::Validate::LookupValidator; | ||
| 2 | # ABSTRACT: abstract base class for lookup-based validation | ||
| 3 | |||
| 4 | 5 | ▶ | use 5.010; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 5 | our $VERSION = '2.000002'; | |
| 9 | 5 | $VERSION =~ tr/_//d; | |
| 10 | 5 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |
| 11 | |||
| 12 | 5 | ▶ | use Exporter 'import'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 5 | our @EXPORT = qw( | |
| 14 | TLookupValidator | ||
| 15 | new_TLookupValidator | ||
| 16 | ); | ||
| 17 | |||
| 18 | 5 | ▶ | use TUI::toolkit; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 5 | ▶ | use TUI::toolkit::Types qw( :types ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | 5 | ▶ | use TUI::Validate::Validator; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | sub TLookupValidator() { __PACKAGE__ } | ||
| 24 | sub name() { 'TLookupValidator' }; | ||
| 25 | 0 | ▶ | sub new_TLookupValidator { __PACKAGE__->from(@_) } |
|
Subroutine
new_TLookupValidator: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 26 | |||
| 27 | 5 | extends TValidator; | |
| 28 | |||
| 29 | 2 | ▶ | sub isValid { # $bool ($s) |
|
Subroutine
isValid: called CC=1 SCAR=0.0
Pod
documented
| |||
| 30 | 2 | state $sig = signature( | |
| 31 | method => Object, | ||
| 32 | pos => [Str], | ||
| 33 | ); | ||
| 34 | 2 | my ( $self, $s ) = $sig->( @_ ); | |
| 35 | 2 | return $self->lookup( $s ); | |
| 36 | } | ||
| 37 | |||
| 38 | 4 | ▶ | sub lookup { # $bool ($s) |
|
Subroutine
lookup: called CC=1 SCAR=0.0
Pod
documented
| |||
| 39 | 4 | state $sig = signature( | |
| 40 | method => Object, | ||
| 41 | pos => [Str], | ||
| 42 | ); | ||
| 43 | 4 | my ( $self, $s ) = $sig->( @_ ); | |
| 44 | 4 | return true; | |
| 45 | } | ||
| 46 | |||
| 47 | 5 | 1 | |
| 48 | |||
| 49 | __END__ | ||