Catmandu/IdGenerator/Mock.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 96.7% 30 / 31 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Catmandu/Fix/Builder.pm ↑ Summary Catmandu/Importer/Modules.pm »
1 package Catmandu::IdGenerator::Mock;
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 Catmandu::Util qw(check_natural);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 with 'Catmandu::IdGenerator';
12  
13 has first_id =>
14 3 ▶ (is => 'ro', isa => sub {check_natural($_[0])}, default => sub {0},);
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
15  
16 2 has next_id =>
17 (is => 'rwp', init_arg => undef, lazy => 1, builder => 'first_id',);
18  
19 30 ▶sub generate {
Subroutine generate: called CC=1 SCAR=0.0
Pod undocumented
20 30 my ($self) = @_;
21 30 my $id = $self->next_id;
22 30 $self->_set_next_id($id + 1);
23 30 $id;
24 }
25  
26 2 1;
27  
28 __END__
« Catmandu/Fix/Builder.pm ↑ Summary Catmandu/Importer/Modules.pm »