line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::AdServer::Database; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$WWW::AdServer::Database::VERSION = '1.01'; |
4
|
|
|
|
|
|
|
} |
5
|
1
|
|
|
1
|
|
7
|
use Moo; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has dsn => ( |
8
|
|
|
|
|
|
|
is => 'ro', |
9
|
|
|
|
|
|
|
required => 1, |
10
|
|
|
|
|
|
|
); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has type => ( |
13
|
|
|
|
|
|
|
is => 'rw', |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has db => ( |
17
|
|
|
|
|
|
|
is => 'rw', |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub BUILD { |
22
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
if (not $self->type) { |
25
|
0
|
0
|
|
|
|
|
if ($self->dsn =~ /\.yml$/) { |
26
|
0
|
|
|
|
|
|
$self->type('YAML'); |
27
|
0
|
|
|
|
|
|
with 'WWW::AdServer::Database::YAML'; |
28
|
0
|
|
|
|
|
|
$self->db( $self->load($self->dsn) ); |
29
|
|
|
|
|
|
|
#$self->db( WWW::AdServer::Database::YAML->new ); |
30
|
|
|
|
|
|
|
#$self->db->load($self->dsn); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
0
|
|
|
|
|
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |