API2/Basic/PDF/Bool.pm

filter: Statementstmt 90.0% 9 / 10 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 2 / 2 totaltotal 83.3% 15 / 18 SCAR 7.0
CC
2
Cov
83%
as_pdf
2.1
convert
2.0
BEGIN
1.0
CRAP 2.0
« API2/Resource/ExtGState.pm ↑ Summary API2/Resource/XObject.pm »
1 # Code in the PDF::API2::Basic::PDF namespace was originally copied from the
2 # Text::PDF distribution.
3 #
4 # Copyright Martin Hosken <Martin_Hosken@sil.org>
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::Bool;
10  
11 40 ▶use base 'PDF::API2::Basic::PDF::String';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 40 our $VERSION = '2.044'; # VERSION
16  
17 =head1 NAME
18  
19 PDF::API2::Basic::PDF::Bool - Low-level PDF boolean object
20 B<true> or B<false>
21  
22 =head1 METHODS
23  
24 =head2 $b->convert($str)
25  
26 Converts a string into the string which will be stored.
27  
28 =cut
29  
30 sub convert {
31 0 ▶ return $_[1] eq 'true';
Subroutine convert: not called CC=1 SCAR=6.9
Pod documented
32 }
33  
34 =head2 as_pdf
35  
36 Converts the value to a PDF output form
37  
38 =cut
39  
40 sub as_pdf {
41 2 ▶ return $_[0]->{'val'} ? 'true' : 'false';
Subroutine as_pdf: called CC=2 SCAR=7.6
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_[0]{'val'} ? : 2 0 2
42 }
43  
44 40 1;
« API2/Resource/ExtGState.pm ↑ Summary API2/Resource/XObject.pm »