line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lego::Part::Image::PeeronCom; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Pragmas. |
4
|
4
|
|
|
4
|
|
61421
|
use base qw(Lego::Part::Image); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1912
|
|
5
|
4
|
|
|
4
|
|
19
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
75
|
|
6
|
4
|
|
|
4
|
|
41
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
98
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# Modules. |
9
|
4
|
|
|
4
|
|
18
|
use Error::Pure qw(err); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
598
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Version. |
12
|
|
|
|
|
|
|
our $VERSION = 0.04; |
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
|
|
|
|
|
|
|
my $url = sprintf 'http://media.peeron.com/ldraw/images/%d/100/%s.png', |
24
|
0
|
|
|
|
|
|
$self->{'part'}->color, $self->{'part'}->design_id; |
25
|
0
|
|
|
|
|
|
return $url; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |