File Coverage

blib/lib/Renard/Incunabula/Document/Types.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1 1     1   7 use Renard::Incunabula::Common::Setup;
  1         2  
  1         7  
2             package Renard::Incunabula::Document::Types;
3             # ABSTRACT: Type library for document types
4             $Renard::Incunabula::Document::Types::VERSION = '0.005';
5 1         10 use Type::Library 0.008 -base,
6             -declare => [qw(
7             DocumentModel
8             PageNumber
9             PageCount
10             LaxPageNumber
11             ZoomLevel
12 1     1   6444 )];
  1         26  
13 1     1   267 use Type::Utils -all;
  1         2  
  1         7  
14              
15 1     1   2778 use Types::Common::Numeric qw(PositiveInt PositiveOrZeroInt PositiveNum);
  1         2  
  1         11  
16              
17             class_type "DocumentModel",
18             { class => "Renard::Incunabula::Document" };
19              
20             declare "PageNumber", parent => PositiveInt;
21              
22             declare "PageCount", parent => PositiveInt;
23              
24             declare "LaxPageNumber", parent => PositiveOrZeroInt;
25              
26             declare "ZoomLevel", parent => PositiveNum;
27              
28             1;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Renard::Incunabula::Document::Types - Type library for document types
39              
40             =head1 VERSION
41              
42             version 0.005
43              
44             =head1 EXTENDS
45              
46             =over 4
47              
48             =item * L<Type::Library>
49              
50             =back
51              
52             =head1 TYPES
53              
54             =head2 DocumentModel
55              
56             A type for any reference that extends L<Renard::Incunabula::Document>.
57              
58             =head2 PageNumber
59              
60             An alias to L<PositiveInt> that can be used for document page number semantics.
61              
62             =head2 PageCount
63              
64             An alias to L<PositiveInt> that can be used for document page number count semantics.
65              
66             =head2 LaxPageNumber
67              
68             An alias to L<PositiveOrZeroInt> that can be used for document page number
69             semantics when the source data may contain invalid pages.
70              
71             =head2 ZoomLevel
72              
73             The amount to zoom in on a page. This is a multiplier such that
74              
75             =over 4
76              
77             =item *
78              
79             when the value is C<1.0>, the page area is the standard area
80              
81             =item *
82              
83             when the value is C<2.0>, the page is C<4> times the standard area
84              
85             =item *
86              
87             when the value is C<0.5>, the page is C<0.25> times the standard area
88              
89             =back
90              
91             =head1 AUTHOR
92              
93             Project Renard
94              
95             =head1 COPYRIGHT AND LICENSE
96              
97             This software is copyright (c) 2017 by Project Renard.
98              
99             This is free software; you can redistribute it and/or modify it under
100             the same terms as the Perl 5 programming language system itself.
101              
102             =cut