File Coverage

blib/lib/KiokuDB/TypeMap/Entry.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2              
3             package KiokuDB::TypeMap::Entry;
4 28     28   6308 use Moose::Role;
  28         18316  
  28         184  
5              
6 28     28   100379 use namespace::clean -except => 'meta';
  28         48  
  28         233  
7              
8             requires "compile";
9              
10             __PACKAGE__
11              
12             __END__
13              
14             =pod
15              
16             =head1 NAME
17              
18             KiokuDB::TypeMap::Entry - Role for L<KiokuDB::TypeMap> entries
19              
20             =head1 SYNOPSIS
21              
22             package KiokuDB::TypeMap::Foo;
23             use Moose;
24              
25             with qw(KiokuDB::TypeMap::Entry);
26              
27             # or just use KiokuDB::TypeMap::Entry::Std
28              
29             sub compile {
30             ...
31             }
32              
33             =head1 DESCRIPTION
34              
35             This is the role consumed by all typemap entries.
36              
37             =head1 REQUIRED METHODS
38              
39             =over 4
40              
41             =item compile $class
42              
43             This method is called by L<KiokuDB::TypeMap::Resolver> for a given class, and
44             should return two code references, one for collapsing and one for expanding.
45              
46             The collapsing sub is called as a method on L<KiokuDB::Collapser> and the
47             expanding sub is called on L<KiokuDB::Linker>.
48              
49             The callbacks must call other L<KiokuDB::Collapser> and L<KiokuDB::Linker>
50             methods to actually get the work done.
51              
52             L<KiokuDB::TypeMap::Entry::Std> provides a more concise way of defining typemap entries.
53              
54             =back