File Coverage

lib/Text/Tradition/Datatypes.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Text::Tradition::Datatypes;
2              
3 10     10   72 use Moose::Util::TypeConstraints;
  10         25  
  10         98  
4 10     10   27972 use XML::Easy::Syntax qw( $xml10_name_rx );
  10         160149  
  10         4701  
5              
6             enum 'Ternary' => [ qw( yes maybe no ) ];
7              
8             enum 'RelationshipScope' => [ qw( local document global ) ];
9              
10             enum 'TextDirection' => [ qw( LR RL BI ) ];
11              
12             subtype 'ReadingID',
13             as 'Str',
14             where { $_ =~ /\A$xml10_name_rx\z/ },
15             message { 'Reading ID must be a valid XML attribute string' };
16            
17             subtype 'SourceType',
18             as 'Str',
19             where { $_ =~ /^(xmldesc|plaintext|json|collation)$/ },
20             message { 'Source type must be one of xmldesc, plaintext, json, collation' };
21            
22             subtype 'Sigil',
23             as 'Str',
24             where { $_ =~ /\A$xml10_name_rx\z/ },
25             message { 'Sigil must be a valid XML attribute string' };
26              
27             1;
28              
29             =head1 NAME
30              
31             Text::Tradition::Datatypes - custom Moose data types for the Tradition package
32              
33             =head1 DESCRIPTION
34              
35             An internal class with the more complex data types we need.
36              
37             =head1 LICENSE
38              
39             This package is free software and is provided "as is" without express
40             or implied warranty. You can redistribute it and/or modify it under
41             the same terms as Perl itself.
42              
43             =head1 AUTHOR
44              
45             Tara L Andrews E<lt>aurum@cpan.orgE<gt>