Catmandu/Fix/format.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 100% 37 / 37 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Catmandu/Fix/export_to_string.pm ↑ Summary Catmandu/Fix/from_json.pm »
1 package Catmandu::Fix::format;
2  
3 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $VERSION = '1.2025';
6  
7 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Catmandu::Util::Path qw(as_path);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 with 'Catmandu::Fix::Builder';
13  
14 1 has path => (fix_arg => 1);
15 1 has spec => (fix_arg => 1);
16  
17 3 ▶sub _build_fixer {
Subroutine _build_fixer: called CC=1 SCAR=0.0
18 3 my ($self) = @_;
19 3 my $spec = $self->spec;
20 as_path($self->path)->updater(
21 1 ▶ if_string => sub {sprintf($spec, $_[0])},
Subroutine __ANON__: called CC=1 SCAR=0.0
22 1 ▶ if_array_ref => sub {sprintf($spec, @{$_[0]})},
Subroutine __ANON__: called CC=1 SCAR=0.0
23 1 ▶ if_hash_ref => sub {sprintf($spec, %{$_[0]})},
Subroutine __ANON__: called CC=1 SCAR=0.0
24 3 );
25 }
26  
27 1 1;
28  
29 __END__
« Catmandu/Fix/export_to_string.pm ↑ Summary Catmandu/Fix/from_json.pm »