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 4     4   204306 use base qw(Lego::Part::Image);
  4         8  
  4         1989  
4 4     4   29 use strict;
  4         8  
  4         94  
5 4     4   18 use warnings;
  4         8  
  4         222  
6              
7 4     4   23 use Error::Pure qw(err);
  4         5  
  4         717  
8              
9             our $VERSION = 0.06;
10              
11             # Get image URL.
12             sub image_url {
13 2     2 1 5 my $self = shift;
14              
15 2 100       6 if (! defined $self->{'part'}->design_id) {
16 1         31 err "Design ID doesn't defined.";
17             }
18             my $url = sprintf 'http://img.lugnet.com/ld/%s.gif',
19 1         12 $self->{'part'}->design_id;
20              
21 1         8 return $url;
22             }
23              
24             1;
25              
26             __END__