| 1 | package WWW::AdServer::Database; | ||||||||||
| 2 | { | ||||||||||
| 3 | 1 | $WWW::AdServer::Database::VERSION = '1.01'; | |||||||||
| 4 | } | ||||||||||
| 5 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | has dsn => ( | |||||||||
| 8 | is => 'ro', | ||||||||||
| 9 | required => 1, | ||||||||||
| 10 | ); | ||||||||||
| 11 | |||||||||||
| 12 | 1 | has type => ( | |||||||||
| 13 | is => 'rw', | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | 1 | has db => ( | |||||||||
| 17 | is => 'rw', | ||||||||||
| 18 | ); | ||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | 1 | ▶ | sub BUILD { | ||||||||
|
Subroutine
BUILD: called CC=3 SCAR=12.3
Pod
undocumented
| |||||||||||
| 22 | 1 | my ($self) = @_; | |||||||||
| 23 | |||||||||||
| 24 | 1 | ▶ | if (not $self->type) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 1 | ▶ | if ($self->dsn =~ /\.yml$/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 1 | $self->type('YAML'); | |||||||||
| 27 | 1 | 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 | 1; | |||||||||
| 37 | |||||||||||
| 38 | __END__ | ||||||||||