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
|
3
|
|
|
3
|
|
13891
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
80
|
|
33
|
3
|
|
|
3
|
|
9
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
50
|
|
34
|
3
|
|
|
3
|
|
8
|
use Carp; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
149
|
|
35
|
3
|
|
|
3
|
|
488
|
use Net::GNUDB::Cd; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
69
|
|
36
|
3
|
|
|
3
|
|
12
|
use base qw(Net::GNUDB::Cd); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
660
|
|
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
|
51
|
|
|
51
|
1
|
470
|
my($class, $config) = @_; |
57
|
51
|
|
|
|
|
82
|
my $self = $class->SUPER::new($config); |
58
|
51
|
|
|
|
|
35
|
$self->{'__album'} = undef; |
59
|
51
|
|
|
|
|
36
|
$self->{'__artist'} = undef; |
60
|
51
|
|
|
|
|
49
|
bless $self, $class; |
61
|
51
|
|
|
|
|
47
|
$self->__setAlbum($config->{'album'}); |
62
|
51
|
|
|
|
|
66
|
$self->__setArtist($config->{'artist'}); |
63
|
51
|
|
|
|
|
51
|
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
|
|
|
|
|
5
|
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
|
439
|
my $self = shift; |
93
|
1
|
|
|
|
|
4
|
return $self->{'__artist'}; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
######################################################### |
96
|
|
|
|
|
|
|
sub __setAlbum{ |
97
|
51
|
|
|
51
|
|
28
|
my($self, $album) = @_; |
98
|
51
|
|
|
|
|
59
|
$self->{'__album'} = $album; |
99
|
51
|
|
|
|
|
38
|
return 1; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
######################################################### |
102
|
|
|
|
|
|
|
sub __setArtist{ |
103
|
51
|
|
|
51
|
|
34
|
my($self, $artist) = @_; |
104
|
51
|
|
|
|
|
44
|
$self->{'__artist'} = $artist; |
105
|
51
|
|
|
|
|
27
|
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; |