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