Builder/Basic/PDF/Bool.pm

filter: Statementstmt 92.8% 13 / 14 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 2 / 2 totaltotal 86.9% 20 / 23 CC 2 SCAR 4.4
CC
2
Cov
88%
as_pdf
2.1
convert
2.0
BEGIN
1.0
CRAP 1.5
« Builder/Basic/PDF/Utils.pm ↑ Summary Builder/Basic/PDF/Null.pm »
1 #=======================================================================
2 #
3 # THIS IS A REUSED PERL MODULE, FOR PROPER LICENCING TERMS SEE BELOW:
4 #
5 # Copyright Martin Hosken <Martin_Hosken@sil.org>
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::Bool;
17  
18 42 ▶use base 'PDF::Builder::Basic::PDF::String';
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 42 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 42 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 42 our $VERSION = '3.028'; # VERSION
24 42 our $LAST_UPDATE = '3.027'; # manually update whenever code is changed
25  
26 =head1 NAME
27  
28 PDF::Builder::Basic::PDF::Bool - Holds the strings B<true> or B<false>
29  
30 Inherits from L<PDF::Builder::Basic::PDF::String>
31  
32 =head1 METHODS
33  
34 =head2 convert
35  
36 $b->convert($str)
37  
38 =over
39  
40 Converts a string into the string which will be stored.
41  
42 =back
43  
44 =cut
45  
46 0 ▶sub convert {
Subroutine convert: not called CC=1 SCAR=6.9
Pod documented
47 0 return $_[1] eq 'true';
48 }
49  
50 =head2 as_pdf
51  
52 $b->as_pdf()
53  
54 =over
55  
56 Converts the value to a PDF output form.
57  
58 =back
59  
60 =cut
61  
62 4 ▶sub as_pdf {
Subroutine as_pdf: called CC=2 SCAR=7.6
Pod documented
63 4 ▶ return $_[0]->{'val'}? 'true': 'false';
Branch: 1 branch
BranchTrueFalseTotal
$_[0]{'val'} ? : 4 0 4
64 }
65  
66 42 1;
« Builder/Basic/PDF/Utils.pm ↑ Summary Builder/Basic/PDF/Null.pm »