File Coverage

blib/lib/PDF/Builder/Basic/PDF/Number.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 18 18 100.0


line stmt bran cond sub pod time code
1             #=======================================================================
2             #
3             # THIS IS A REUSED PERL MODULE, FOR PROPER LICENCING TERMS SEE BELOW:
4             #
5             # Copyright Martin Hosken
6             #
7             # No warranty or expression of effectiveness, least of all regarding
8             # anyone's safety, is implied in this software or documentation.
9             #
10             # This specific module is licensed under the Perl Artistic License.
11             # Effective 28 January 2021, the original author and copyright holder,
12             # Martin Hosken, has given permission to use and redistribute this module
13             # under the MIT license.
14             #
15             #=======================================================================
16             package PDF::Builder::Basic::PDF::Number;
17              
18 37     37   264 use base 'PDF::Builder::Basic::PDF::String';
  37         103  
  37         3755  
19              
20 37     37   239 use strict;
  37         83  
  37         747  
21 37     37   170 use warnings;
  37         71  
  37         4263  
22              
23             our $VERSION = '3.023'; # VERSION
24             our $LAST_UPDATE = '3.022'; # manually update whenever code is changed
25              
26             =head1 NAME
27              
28             PDF::Builder::Basic::PDF::Number - Numbers in PDF. Inherits from L
29              
30             =head1 METHODS
31              
32             =head2 $n->convert($str)
33              
34             Converts a string from PDF to internal, by doing nothing
35              
36             =cut
37              
38             sub convert {
39 345     345 1 912 return $_[1];
40             }
41              
42             =head2 $n->as_pdf()
43              
44             Converts a number to PDF format
45              
46             =cut
47              
48             sub as_pdf {
49 4866     4866 1 13154 return $_[0]->{'val'};
50             }
51              
52             1;