blib/lib/Net/GNUDBSearch/Cd.pm untested

filter: Statementstmt 0.0% 0 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 49 SCAR 6.9
CC
1
Cov
0%
new
2.0
getAlbum
2.0
getArtist
2.0
CRAP 2.0
1 package Net::GNUDBSearch::Cd;
2  
3 =pod
4  
5 =head1 NAME
6  
7 Net::GNUDBSearch::Cd - Storage for L<Net::GNUDBSearch> results.
8  
9 =head1 SYNOPSIS
10  
11 use Net::GNUDBSearch::Cd;
12 my $config = {
13 'album' => 'Alway Outnumbered, Never Outgunned',
14 'artist' => 'The Prodigy',
15 'id' => '950cc10c',
16 'genre' => 'misc'
17 }
18 my $searchCd = Net::GNUDBSearch::Cd->new($config);
19 my $artist = $searchCd->getArtist();
20 my $album = $searchCd->getAlbum();
21  
22 =head1 DESCRIPTION
23  
24 Class for storage of L<Net::GNUDBSearch> results, normally not instantiated directly but can used to lookup a specific GNUDB entry.
25  
26 For inherited methods see L<Net::GNUDB::Cd>.
27  
28 =head1 METHODS
29  
30 =cut
31  
32 use warnings;
33 use strict;
34 use Carp;
35 use Net::GNUDB::Cd;
36 use base qw(Net::GNUDB::Cd);
37 #########################################################
38  
39 =head2 new($config)
40  
41 my $config = {
42 'album' => 'Alway Outnumbered, Never Outgunned',
43 'artist' => 'The Prodigy',
44 'id' => '950cc10c',
45 'genre' => 'misc'
46 }
47 my $searchCd = Net::GNUDBSearch::Cd->new($config);
48  
49 Constructor, returns a new instance of the search CD object. Requires all four of the above elements in the provided hash reference for operation. These
50 elements must match a GNUDB entry.
51  
52 =cut
53  
54 #########################################################
55 sub new{
56 my($class, $config) = @_;
57 my $self = $class->SUPER::new($config);
58 $self->{'__album'} = undef;
59 $self->{'__artist'} = undef;
60 bless $self, $class;
61 $self->__setAlbum($config->{'album'});
62 $self->__setArtist($config->{'artist'});
63 return $self;
64 }
65 #########################################################
66  
67 =head2 getAlbum()
68  
69 my $albumName = $searchCd->getAlbum()
70  
71 Returns the same album name string as given in the config on object creation.
72  
73 =cut
74  
75 #########################################################
76 sub getAlbum{
77 my $self = shift;
78 return $self->{'__album'};
79 }
80 #########################################################
81  
82 =head2 getArtist()
83  
84 my $artistName = $searchCd->getArtist()
85  
86 Returns the same artist name string as given in the config on object creation.
87  
88 =cut
89  
90 #########################################################
91 sub getArtist{
92 my $self = shift;
93 return $self->{'__artist'};
94 }
95 #########################################################
96 sub __setAlbum{
97 my($self, $album) = @_;
98 $self->{'__album'} = $album;
99 return 1;
100 }
101 #########################################################
102 sub __setArtist{
103 my($self, $artist) = @_;
104 $self->{'__artist'} = $artist;
105 return 1;
106 }
107 #########################################################
108  
109 =pod
110  
111 =head1 Author
112  
113 MacGyveR <dumb@cpan.org>
114  
115 Development questions, bug reports, and patches are welcome to the above address.
116  
117 =head1 Copyright
118  
119 Copyright (c) 2012 MacGyveR. All rights reserved.
120  
121 This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
122  
123 =head1 See Also
124  
125 L<Net::GNUDBSearch::Cd>
126  
127 =cut
128  
129 #########################################################
130 return 1;