| 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
| |||||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 42 | 1; | |||||||||