| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::GNUDBSearch::Cd; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Net::GNUDBSearch::Cd - Storage for L 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 results, normally not instantiated directly but can used to lookup a specific GNUDB entry. |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
For inherited methods see L. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 METHODS |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
|
31
|
|
|
|
|
|
|
|
|
32
|
2
|
|
|
2
|
|
32622
|
use warnings; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
73
|
|
|
33
|
2
|
|
|
2
|
|
10
|
use strict; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
164
|
|
|
34
|
2
|
|
|
2
|
|
57
|
use Carp; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
361
|
|
|
35
|
2
|
|
|
2
|
|
456
|
use Net::GNUDB::Cd; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
67
|
|
|
36
|
2
|
|
|
2
|
|
20
|
use base qw(Net::GNUDB::Cd); |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
705
|
|
|
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
|
1
|
|
|
1
|
1
|
556
|
my($class, $config) = @_; |
|
57
|
1
|
|
|
|
|
11
|
my $self = $class->SUPER::new($config); |
|
58
|
1
|
|
|
|
|
2
|
$self->{'__album'} = undef; |
|
59
|
1
|
|
|
|
|
4
|
$self->{'__artist'} = undef; |
|
60
|
1
|
|
|
|
|
1
|
bless $self, $class; |
|
61
|
1
|
|
|
|
|
4
|
$self->__setAlbum($config->{'album'}); |
|
62
|
1
|
|
|
|
|
5
|
$self->__setArtist($config->{'artist'}); |
|
63
|
1
|
|
|
|
|
2
|
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
|
1
|
|
|
1
|
1
|
1
|
my $self = shift; |
|
78
|
1
|
|
|
|
|
8
|
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
|
1
|
|
|
1
|
1
|
667
|
my $self = shift; |
|
93
|
1
|
|
|
|
|
7
|
return $self->{'__artist'}; |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
######################################################### |
|
96
|
|
|
|
|
|
|
sub __setAlbum{ |
|
97
|
1
|
|
|
1
|
|
3
|
my($self, $album) = @_; |
|
98
|
1
|
|
|
|
|
2
|
$self->{'__album'} = $album; |
|
99
|
1
|
|
|
|
|
23
|
return 1; |
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
######################################################### |
|
102
|
|
|
|
|
|
|
sub __setArtist{ |
|
103
|
1
|
|
|
1
|
|
3
|
my($self, $artist) = @_; |
|
104
|
1
|
|
|
|
|
2
|
$self->{'__artist'} = $artist; |
|
105
|
1
|
|
|
|
|
2
|
return 1; |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
######################################################### |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=pod |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 Author |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
MacGyveR |
|
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 |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=cut |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
######################################################### |
|
130
|
|
|
|
|
|
|
return 1; |