File Coverage

blib/lib/DynGig/Range/Cluster/EZDB.pm
Criterion Covered Total %
statement 9 15 60.0
branch 0 2 0.0
condition n/a
subroutine 3 5 60.0
pod 1 2 50.0
total 13 24 54.1


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             DynGig::Range::Cluster::EZDB - Extends DynGig::Util::EZDB
4              
5             =cut
6             package DynGig::Range::Cluster::EZDB;
7              
8 1     1   7 use base DynGig::Util::EZDB;
  1         3  
  1         2144  
9              
10 1     1   50733 use strict;
  1         3  
  1         41  
11 1     1   6 use warnings;
  1         3  
  1         430  
12              
13             =head1 SCHEMA
14            
15             key TEXT NOT NULL,
16             value TEXT NOT NULL,
17             PRIMARY KEY ( key )
18              
19             =cut
20             sub new
21             {
22 0     0 0   DynGig::Util::EZDB->schema
23             (
24             key => 'TEXT NOT NULL PRIMARY KEY',
25             value => 'TEXT NOT NULL',
26             );
27              
28 0           bless DynGig::Util::EZDB::new( @_ ), __PACKAGE__;
29             }
30              
31             =head1 METHODS
32              
33             See base class for additional methods.
34              
35             =head2 get()
36              
37             Loads all tables into a HASH. Also see dump().
38             Returns HASH reference in scalar context.
39             Returns flattened HASH in list context.
40              
41             =cut
42             sub get
43             {
44 0     0 1   my $this = shift;
45 0           my %config = map { $_ => scalar $this->dump( $_ ) } $this->table();
  0            
46              
47 0 0         return wantarray ? %config : \%config;
48             }
49              
50             =head1 NOTE
51              
52             See DynGig::Range::Cluster
53              
54             =cut
55              
56             1;
57              
58             __END__