blib/lib/Catmandu/Fix/Base.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 96.4% 27 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Catmandu/Serializer.pm ↑ Summary blib/lib/Catmandu/Fix/sum.pm »
1 package Catmandu::Fix::Base;
2  
3 80 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 80 our $VERSION = '1.0201_02';
6  
7 80 ▶use Catmandu::Fix;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 80 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 80 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 80 with 'Catmandu::Fix::Inlineable', 'Catmandu::Logger';
12  
13 80 requires 'emit';
14  
15 80 has fixer => (is => 'lazy', init_arg => undef);
16  
17 sub _build_fixer {
18 167 ▶ my ($self) = @_;
Subroutine _build_fixer: called CC=1 SCAR=0.0
19 167 Catmandu::Fix->new(fixes => [$self]);
20 }
21  
22 sub fix {
23 242 ▶ my ($self, $data) = @_;
Subroutine fix: called CC=1 SCAR=0.0
Pod undocumented
24 242 $self->fixer->fix($data);
25 }
26  
27 80 1;
28  
29 __END__
30  
31 =pod
32  
33 =head1 NAME
34  
35 Catmandu::Fix::Base - Base class for all code emitting Catmandu fixes
36  
37 =head1 SYNOPSIS
38  
39 package Catmandu::Fix::my_fix;
40  
41 use Catmandu::Sane;
42 use Moo;
43  
44 with 'Catmandu::Fix::Base';
45  
46 sub emit {
47 my ($self, $fixer) = @_;
48 ....FIXER GENERATING CODE....
49 }
50  
51 =head1 SEE ALSO
52  
53 For more information how to create fixes read the following two blog posts:
54  
55 http://librecat.org/catmandu/2014/03/14/create-a-fixer.html
56 http://librecat.org/catmandu/2014/03/26/creating-a-fixer-2.html
57 =cut
« blib/lib/Catmandu/Serializer.pm ↑ Summary blib/lib/Catmandu/Fix/sum.pm »