| 1 | # Connector::Types | ||
| 2 | # | ||
| 3 | # Utility class containing customized Moose types and constraints | ||
| 4 | # | ||
| 5 | # Written by Martin Bartosch for the OpenXPKI project 2012 | ||
| 6 | # | ||
| 7 | package Connector::Types; | ||
| 8 | |||
| 9 | 23 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 23 | ▶ | use Moose::Util::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | ########################################################################### | ||
| 13 | # Types | ||
| 14 | subtype 'Connector::Types::Char' | ||
| 15 | => as 'Str', | ||
| 16 | 52 | ▶ | => where { length($_) == 1 } |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 17 | 0 | ▶ | => message { 'Exactly one character expected' }; |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 18 | |||
| 19 | # location for a connector | ||
| 20 | 23 | subtype 'Connector::Types::Location' | |
| 21 | => as 'Str'; | ||
| 22 | |||
| 23 | # unique key for accessing records | ||
| 24 | 23 | subtype 'Connector::Types::Key' | |
| 25 | => as 'Str'; | ||
| 26 | |||
| 27 | |||
| 28 | 23 | 1; | |
| 29 | |||