Metalgate/Artist.pm untested

filter: Statementstmt 0.0% 0 / 38 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 54 CC 3 SCAR 15.0
CC
3
Cov
0%
BUILD
12.0
review
2.0
BEGIN
2.0
CRAP 4.5
1 package WWW::Metalgate::Artist;
2  
3 use warnings;
4 use strict;
5  
6 use Moose;
7 use MooseX::Types::URI qw(Uri FileUri DataUri);
8 use Web::Scraper;
9 use WWW::Metalgate::ReviewIndex;
10 use WWW::Metalgate::Review;
11 use List::Util qw(first);
12  
13 =head1 NAME
14  
15 WWW::Metalgate::Artist
16  
17 =head1 VERSION
18  
19 Version 0.01
20  
21 =cut
22  
23 our $VERSION = '0.01';
24  
25 =head1 FUNCTIONS
26  
27 =head2 uri
28  
29 =head2 year
30  
31 =head2 html
32  
33 =cut
34  
35 has 'uri' => (is => 'rw', isa => Uri, coerce => 1);
36 has 'name' => (is => 'rw', isa => 'Str', required => 1);
37  
38 with 'WWW::Metalgate::Role::Html';
39  
40 =head2 BUILD
41  
42 =cut
43  
44 sub BUILD {
45 my $self = shift;
46  
47 unless ($self->uri) {
48 my @artists = WWW::Metalgate::ReviewIndex->new->artists;
49 my $artist = first { lc($_->name) eq lc($self->name) } @artists;
50 die sprintf("Artist %s is not found.", $self->name) unless $artist;
51 $self->name( $artist->name );
52 $self->uri( $artist->uri );
53 }
54 }
55  
56 =head2 review
57  
58 =cut
59  
60 sub review {
61 my $self = shift;
62 WWW::Metalgate::Review->new( artist => $self );
63 }
64  
65 =head1 AUTHOR
66  
67 Tomohiro Hosaka, C<< <bokutin at cpan.org> >>
68  
69 =head1 COPYRIGHT & LICENSE
70  
71 Copyright 2008 Tomohiro Hosaka, all rights reserved.
72  
73 This program is free software; you can redistribute it and/or modify it
74 under the same terms as Perl itself.
75  
76 =cut
77  
78 1;