KiokuDB/TypeMap/Default/Passthrough.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 22 / 22 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
_build_datetime_typemap
1.0
CRAP 1.0
« KiokuDB/TypeMap/ClassBuilders.pm ↑ Summary KiokuDB/TypeMap/Default/Storable.pm »
1 #!/usr/bin/perl
2  
3 package KiokuDB::TypeMap::Default::Passthrough;
4 22 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 22 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 22 with qw(KiokuDB::TypeMap::Default);
9  
10 sub _build_datetime_typemap {
11 43 ▶ my $self = shift;
Subroutine _build_datetime_typemap: called CC=1 SCAR=0.0
12  
13 43 $self->_create_typemap(
14 isa_entries => {
15 'DateTime' => => {
16 type => 'KiokuDB::TypeMap::Entry::Passthrough',
17 intrinsic => 1,
18 },
19 'DateTime::Duration' => => {
20 type => 'KiokuDB::TypeMap::Entry::Passthrough',
21 intrinsic => 1,
22 },
23 },
24 );
25 }
26  
27 sub _build_path_class_typemap {
28 43 ▶ my $self = shift;
Subroutine _build_path_class_typemap: called CC=1 SCAR=0.0
29  
30 43 $self->_create_typemap(
31 isa_entries => {
32 'Path::Class::Entity' => {
33 type => "KiokuDB::TypeMap::Entry::Passthrough",
34 intrinsic => 1,
35 },
36 },
37 );
38 }
39  
40 sub _build_uri_typemap {
41 43 ▶ my $self = shift;
Subroutine _build_uri_typemap: called CC=1 SCAR=0.0
42  
43 43 $self->_create_typemap(
44 isa_entries => {
45 'URI' => {
46 type => "KiokuDB::TypeMap::Entry::Passthrough",
47 intrinsic => 1,
48 },
49 },
50 entries => {
51 'URI::WithBase' => {
52 type => "KiokuDB::TypeMap::Entry::Passthrough",
53 intrinsic => 1,
54 },
55 },
56 );
57 }
58  
59 sub _build_authen_passphrase_typemap {
60 43 ▶ my $self = shift;
Subroutine _build_authen_passphrase_typemap: called CC=1 SCAR=0.0
61  
62 43 $self->_create_typemap(
63 isa_entries => {
64 # since Authen::Passphrase dynamically loads subcomponents based on
65 # type, passthrough causes issues with the class not being defined
66 # at load time unless explicitly loaded by the user.
67 # this works around this issue
68 #'Authen::Passphrase' => {
69 # type => "KiokuDB::TypeMap::Entry::Passthrough",
70 # intrinsic => 1,
71 #},
72 'Authen::Passphrase' => {
73 type => "KiokuDB::TypeMap::Entry::Callback",
74 intrinsic => 1,
75 collapse => "as_rfc2307",
76 expand => "from_rfc2307",
77 },
78 },
79 );
80 }
81  
82 22 __PACKAGE__
83  
84 __END__
85  
86 =pod
87  
88 =head1 NAME
89  
90 KiokuDB::TypeMap::Default::Passthrough - A L<KiokuDB::TypeMap::Default>
91 instance suitable for L<Storable>.
92  
93 =head1 DESCRIPTION
94  
95 This typemap lets most of the default data types be passed through untouched,
96 so that their own L<Storable> hooks may be invoked.
« KiokuDB/TypeMap/ClassBuilders.pm ↑ Summary KiokuDB/TypeMap/Default/Storable.pm »