Image/PeeronCom.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 31 / 31 CC 3 SCAR 6.2
CC
3
Cov
100%
image_url
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« Image/BricklinkCom.pm ↑ Summary Image/LegoCom.pm »
1 package Lego::Part::Image::PeeronCom;
2  
3 4 ▶use base qw(Lego::Part::Image);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use Error::Pure qw(err);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 our $VERSION = 0.06;
10  
11 # Get image URL.
12 3 ▶sub image_url {
Subroutine image_url: called CC=3 SCAR=11.0
Pod documented
13 3 my $self = shift;
14  
15 3 ▶ if (! defined $self->{'part'}->color) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"part"}->color) 1 2 3
16 1 err "Color doesn't defined.";
17 }
18 2 ▶ if (! defined $self->{'part'}->design_id) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"part"}->design_id) 1 1 2
19 1 err "Design ID doesn't defined.";
20 }
21 my $url = sprintf 'http://media.peeron.com/ldraw/images/%d/100/%s.png',
22 1 $self->{'part'}->color, $self->{'part'}->design_id;
23  
24 1 return $url;
25 }
26  
27 4 1;
28  
29 __END__
« Image/BricklinkCom.pm ↑ Summary Image/LegoCom.pm »