Catmandu/Fix/retain_field.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 96.5% 28 / 29 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Catmandu/Serializer.pm ↑ Summary Catmandu/Importer/YAML.pm »
1 package Catmandu::Fix::retain_field;
2  
3 2 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 our $VERSION = '1.2025';
6  
7 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 with 'Catmandu::Fix::Base';
12  
13 2 has path => (fix_arg => 1);
14  
15 8 ▶sub emit {
Subroutine emit: called CC=1 SCAR=0.0
Pod undocumented
16 8 my ($self, $fixer) = @_;
17 8 my $path = $fixer->split_path($self->path);
18 8 my $key = pop @$path;
19  
20 $fixer->emit_walk_path(
21 $fixer->var,
22 $path,
23 8 ▶ sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
24 8 my $var = shift;
25 8 $fixer->emit_retain_key($var, $key);
26 }
27 8 );
28 }
29  
30 2 1;
31  
32 __END__
« Catmandu/Serializer.pm ↑ Summary Catmandu/Importer/YAML.pm »