File Coverage

blib/lib/Lego/Part/Image/LugnetCom.pm
Criterion Covered Total %
statement 17 17 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 25 25 100.0


line stmt bran cond sub pod time code
1             package Lego::Part::Image::LugnetCom;
2              
3             # Pragmas.
4 4     4   88524 use base qw(Lego::Part::Image);
  4         8  
  4         2182  
5 4     4   22 use strict;
  4         9  
  4         126  
6 4     4   56 use warnings;
  4         8  
  4         107  
7              
8             # Modules.
9 4     4   17 use Error::Pure qw(err);
  4         7  
  4         499  
10              
11             # Version.
12             our $VERSION = 0.05;
13              
14             # Get image URL.
15             sub image_url {
16 2     2 1 6 my $self = shift;
17 2 100       7 if (! defined $self->{'part'}->design_id) {
18 1         11 err "Design ID doesn't defined.";
19             }
20             my $url = sprintf 'http://img.lugnet.com/ld/%s.gif',
21 1         8 $self->{'part'}->design_id;
22 1         11 return $url;
23             }
24              
25             1;
26              
27             __END__