UPS/Response/Image.pm

filter: Statementstmt 96.9% 32 / 33 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 93.3% 42 / 45 CC 3 SCAR 3.8
CC
3
Cov
92%
BUILDARGS
2.1
__ANON__
2.0
BEGIN
1.0
CRAP 1.5
« UPS/Response/QV.pm ↑ Summary UPS/Label.pm »
1 package Net::Async::Webservice::UPS::Response::Image;
2 1 $Net::Async::Webservice::UPS::Response::Image::VERSION = '1.1.4';
3 {
4 1 $Net::Async::Webservice::UPS::Response::Image::DIST = 'Net-Async-Webservice-UPS';
5 }
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Types::Standard qw(Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Net::Async::Webservice::UPS::Types qw(:types);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 # ABSTRACT: an image in a UPS response
13  
14  
15 1 has format => (
16 is => 'ro',
17 isa => ImageType,
18 required => 0,
19 );
20  
21  
22 1 has data => (
23 is => 'ro',
24 isa => Str,
25 required => 0,
26 );
27  
28  
29 5 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
30 5 my ($orig,$class,@etc) = @_;
31 5 my $args = $class->$orig(@etc);
32  
33 5 ▶ if (my $b64 = delete $args->{base64_data}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $b64 = delete $args->{"base64_data"}) 5 0 5
34 5 $args->{data} = decode_base64($b64);
35 }
36  
37 5 return $args;
38 1 };
39  
40  
41 5 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=2 SCAR=7.2
Pod documented
42 5 my ($class,$hash) = @_;
43  
44 5 my ($format_key) = grep {/ImageFormat$/} keys %$hash;
45  
46 5 ▶ if ($format_key) {
Branch: 1 branch
BranchTrueFalseTotal
if ($format_key) { } 5 0 5
47 return {
48 format => $hash->{$format_key}{Code},
49 base64_data => $hash->{GraphicImage},
50 5 };
51 }
52 else {
53 0 return $hash;
54 }
55 }
56  
57 1 1;
58  
59 __END__
« UPS/Response/QV.pm ↑ Summary UPS/Label.pm »