Builder/Resource/XObject.pm

filter: Statementstmt 100% 23 / 23 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 96.9% 32 / 33 CC 2 SCAR 2.6
CC
2
Cov
96%
subtype
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Builder/Resource/Font/CoreFont/wingdings.pm ↑ Summary Builder/Resource/Pattern.pm »
1 package PDF::Builder::Resource::XObject;
2  
3 39 ▶use base 'PDF::Builder::Resource';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 39 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 39 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 39 our $VERSION = '3.028'; # VERSION
9 39 our $LAST_UPDATE = '3.027'; # manually update whenever code is changed
10  
11 39 ▶use PDF::Builder::Basic::PDF::Utils;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 =head1 NAME
14  
15 PDF::Builder::Resource::XObject - Base class for external objects
16  
17 Inherits from L<PDF::Builder::Resource>
18  
19 =head1 METHODS
20  
21 =head2 new
22  
23 $xobject = PDF::Builder::Resource::XObject->new($pdf, $name)
24  
25 =over
26  
27 Creates an XObject resource.
28  
29 =back
30  
31 =cut
32  
33 27 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
34 27 my ($class, $pdf, $name) = @_;
35  
36 27 my $self = $class->SUPER::new($pdf, $name);
37  
38 27 $self->type('XObject');
39  
40 27 return $self;
41 }
42  
43 =head2 subtype
44  
45 $type = $xobject->subtype($type)
46  
47 =over
48  
49 Get or set the Subtype of the XObject resource.
50  
51 =back
52  
53 =cut
54  
55 27 ▶sub subtype {
Subroutine subtype: called CC=2 SCAR=7.0
Pod documented
56 27 my $self = shift;
57  
58 27 ▶ if (scalar @_) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_) 27 0 27
59 27 $self->{'Subtype'} = PDFName(shift());
60 }
61 27 return $self->{'Subtype'}->val();
62 }
63  
64 39 1;
« Builder/Resource/Font/CoreFont/wingdings.pm ↑ Summary Builder/Resource/Pattern.pm »