File Coverage

blib/lib/PDF/API2/Basic/PDF/Number.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 2 2 100.0
total 14 14 100.0


line stmt bran cond sub pod time code
1             # Code in the PDF::API2::Basic::PDF namespace was originally copied from the
2             # Text::PDF distribution.
3             #
4             # Copyright Martin Hosken
5             #
6             # Martin Hosken's code may be used under the terms of the MIT license.
7             # Subsequent versions of the code have the same license as PDF::API2.
8              
9             package PDF::API2::Basic::PDF::Number;
10              
11 41     41   285 use base 'PDF::API2::Basic::PDF::String';
  41         84  
  41         3786  
12              
13 41     41   252 use strict;
  41         90  
  41         3423  
14              
15             our $VERSION = '2.045'; # VERSION
16              
17             =head1 NAME
18              
19             PDF::API2::Basic::PDF::Number - Low-level PDF numeric object
20              
21             =head1 METHODS
22              
23             =head2 $n->convert($str)
24              
25             Converts a string from PDF to internal, by doing nothing
26              
27             =cut
28              
29             sub convert {
30 82     82 1 280 return $_[1];
31             }
32              
33             =head2 $n->as_pdf
34              
35             Converts a number to PDF format
36              
37             =cut
38              
39             sub as_pdf {
40 589     589 1 1450 return $_[0]->{'val'};
41             }
42              
43             1;