API2/Resource/XObject.pm

filter: Statementstmt 100% 22 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 96.8% 31 / 32 CC 2 SCAR 2.6
CC
2
Cov
96%
subtype
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« API2/Basic/PDF/Null.pm ↑ Summary API2/Resource/Pattern.pm »
1 package PDF::API2::Resource::XObject;
2  
3 39 ▶use base 'PDF::API2::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 = '2.049'; # VERSION
9  
10 39 ▶use PDF::API2::Basic::PDF::Utils;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 =head1 NAME
13  
14 PDF::API2::Resource::XObject - Base class for external objects
15  
16 =head1 METHODS
17  
18 =over
19  
20 =item $xobject = PDF::API2::Resource::XObject->new($pdf, $name)
21  
22 Creates an XObject resource.
23  
24 =cut
25  
26 28 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
27 28 my ($class, $pdf, $name) = @_;
28 28 my $self = $class->SUPER::new($pdf, $name);
29  
30 28 $self->type('XObject');
31  
32 28 return $self;
33 }
34  
35 =item $type = $xobject->subtype($type)
36  
37 Get or set the Subtype of the XObject resource.
38  
39 =cut
40  
41 28 ▶sub subtype {
Subroutine subtype: called CC=2 SCAR=7.0
Pod documented
42 28 my $self = shift();
43 28 ▶ if (scalar @_) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_) 28 0 28
44 28 $self->{'Subtype'} = PDFName(shift());
45 }
46 28 return $self->{'Subtype'}->val();
47 }
48  
49 =back
50  
51 =cut
52  
53 39 1;
« API2/Basic/PDF/Null.pm ↑ Summary API2/Resource/Pattern.pm »