File Coverage

blib/lib/DBICx/DataDictionary.pm
Criterion Covered Total %
statement 33 33 100.0
branch n/a
condition 2 2 100.0
subroutine 8 8 100.0
pod 1 1 100.0
total 44 44 100.0


line stmt bran cond sub pod time code
1             package DBICx::DataDictionary;
2             our $VERSION = '0.002';
3              
4 3     3   166986 use strict;
  3         8  
  3         102  
5 3     3   15 use warnings;
  3         6  
  3         82  
6 3     3   2561 use parent 'Exporter';
  3         932  
  3         15  
7              
8             @DBICx::DataDictionary::EXPORT = qw( add_type );
9              
10             sub import {
11             {
12 3     3   200 no strict 'refs';
  3     3   7  
  3         311  
  3         24  
13 3         4 unshift @{caller().'::ISA'}, 'Exporter';
  3         34  
14             }
15              
16 3         233 goto \&Exporter::import;
17             }
18              
19             sub add_type {
20 6     6 1 26 my ($name, $spec) = @_;
21 6         9 my $ns = caller();
22 6         10 my $full_name = join('::', $ns, $name);
23 6         10 my $export_ok = join('::', $ns, 'EXPORT_OK');
24 6         8 my $export_tags = join('::', $ns, 'EXPORT_TAGS');
25              
26 3     3   15 no strict 'refs';
  3         6  
  3         309  
27 6     9   31 *{$full_name} = sub { +{ %$spec, @_ } };
  6         23  
  9         98236  
28 6         7 push @{$export_ok}, $name;
  6         15  
29 6   100     7 ${$export_tags}{all} ||= \@{$export_ok};
  6         30  
  2         10  
30              
31 6         15 return;
32             }
33              
34             1;
35              
36             __END__