line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lego::Part::Image::PeeronCom; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Pragmas. |
4
|
4
|
|
|
4
|
|
40192
|
use base qw(Lego::Part::Image); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
1380
|
|
5
|
4
|
|
|
4
|
|
17
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
92
|
|
6
|
4
|
|
|
4
|
|
32
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
90
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# Modules. |
9
|
4
|
|
|
4
|
|
13
|
use Error::Pure qw(err); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
464
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Version. |
12
|
|
|
|
|
|
|
our $VERSION = 0.02; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Get image URL. |
15
|
|
|
|
|
|
|
sub image_url { |
16
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
17
|
0
|
0
|
|
|
|
|
if (! defined $self->{'part'}->color) { |
18
|
0
|
|
|
|
|
|
err "Color doesn't defined."; |
19
|
|
|
|
|
|
|
} |
20
|
0
|
0
|
|
|
|
|
if (! defined $self->{'part'}->design_id) { |
21
|
0
|
|
|
|
|
|
err "Design ID doesn't defined."; |
22
|
|
|
|
|
|
|
} |
23
|
0
|
|
|
|
|
|
my $url = sprintf 'http://media.peeron.com/ldraw/images/%d/100/%s.png', |
24
|
|
|
|
|
|
|
$self->{'part'}->color, $self->{'part'}->design_id; |
25
|
0
|
|
|
|
|
|
return $url; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |