KiokuDB/Backend/Serialize/JSPON.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 26 / 26 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« KiokuDB/Backend/Serialize/Delegate.pm ↑ Summary KiokuDB/Backend/TypeMap/Default.pm »
1 #!/usr/bin/perl
2  
3 package KiokuDB::Backend::Serialize::JSPON;
4 6 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 ▶use KiokuDB::Backend::Serialize::JSPON::Expander;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use KiokuDB::Backend::Serialize::JSPON::Collapser;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 6 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 6 with qw(
12 KiokuDB::Backend::TypeMap::Default::JSON
13 KiokuDB::Backend::Serialize::JSPON::Converter
14 );
15  
16 6 has expander => (
17 isa => "KiokuDB::Backend::Serialize::JSPON::Expander",
18 is => "rw",
19 lazy_build => 1,
20 handles => [qw(expand_jspon)],
21 );
22  
23 sub _build_expander {
24 19 ▶ my $self = shift;
Subroutine _build_expander: called CC=1 SCAR=0.0
25  
26 19 KiokuDB::Backend::Serialize::JSPON::Expander->new($self->_jspon_params);
27 }
28  
29 6 has collapser => (
30 isa => "KiokuDB::Backend::Serialize::JSPON::Collapser",
31 is => "rw",
32 lazy_build => 1,
33 handles => [qw(collapse_jspon)],
34 );
35  
36 sub _build_collapser {
37 19 ▶ my $self = shift;
Subroutine _build_collapser: called CC=1 SCAR=0.0
38  
39 19 KiokuDB::Backend::Serialize::JSPON::Collapser->new($self->_jspon_params);
40 }
41  
42 6 __PACKAGE__
43  
44 __END__
45  
46 =pod
47  
48 =head1 NAME
49  
50 KiokuDB::Backend::Serialize::JSPON - JSPON serialization helper
51  
52 =head1 SYNOPSIS
53  
54 with qw(KiokuDB::Backend::Serialize::JSPON);
55  
56 =head1 DESCRIPTION
57  
58 This serialization role provides JSPON semantics for L<KiokuDB::Entry> and
59 L<KiokuDB::Reference> objects.
60  
61 For serialization to JSON strings see L<KiokuDB::Backend::Serialize::JSON>.
62  
63 =head1 METHODS
64  
65 =over 4
66  
67 =item expand_jspon
68  
69 See L<KiokuDB::Backend::Serialize::JSPON::Expander/expand_jspon>
70  
71 =item collapse_jspon
72  
73 See L<KiokuDB::Backend::Serialize::JSPON::Collapser/collapse_jspon>
74  
75 =back
76  
77 =cut
78  
79  
« KiokuDB/Backend/Serialize/Delegate.pm ↑ Summary KiokuDB/Backend/TypeMap/Default.pm »