MailboxOrg/Types.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« MailboxOrg/Role/IO.pm ↑ Summary
1 package WWW::MailboxOrg::Types;
2  
3 # ABSTRACT: Custom types for Mailbox.org API
4  
5 5 ▶use Type::Library -base, -declare => qw( EmailAddress DomainName );
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use Type::Utils -all;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use Types::Standard -types;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 my $meta = __PACKAGE__->meta;
10  
11 declare EmailAddress,
12 as Str,
13 12 ▶ where { /^[^\s@]+@[^\s@]+\.[^\s@]+$/ },
Subroutine __ANON__: called CC=1 SCAR=0.0
14 1 ▶ message { "$_ is not a valid email address" };
Subroutine __ANON__: called CC=1 SCAR=0.0
15  
16 declare DomainName,
17 as Str,
18 11 ▶ where { /^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*\.[a-zA-Z]{2,}$/ },
Subroutine __ANON__: called CC=1 SCAR=0.0
19 1 ▶ message { "$_ is not a valid domain name" };
Subroutine __ANON__: called CC=1 SCAR=0.0
20  
21 5 __PACKAGE__->meta->make_immutable;
22  
23 5 1;
24  
25 __END__
« MailboxOrg/Role/IO.pm ↑ Summary