Reader/Role/HasDecoder.pm

filter: Statementstmt 100% 27 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 100% 35 / 35 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Reader.pm ↑ Summary
1 package MaxMind::DB::Reader::Role::HasDecoder;
2  
3 21 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 21 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 21 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 21 our $VERSION = '1.000014';
8  
9 21 ▶use MaxMind::DB::Common qw( DATA_SECTION_SEPARATOR_SIZE );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 21 ▶use MaxMind::DB::Reader::Decoder;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 21 ▶use MaxMind::DB::Types qw( Decoder );
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 21 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 21 with 'MaxMind::DB::Role::Debugs';
16  
17 # Can't require accessors :(
18 # requires 'data_source', '_search_tree_size';
19  
20 21 has _decoder => (
21 is => 'ro',
22 isa => Decoder,
23 init_arg => undef,
24 lazy => 1,
25 builder => '_build_decoder',
26 );
27  
28 16 ▶sub _build_decoder {
Subroutine _build_decoder: called CC=1 SCAR=0.0
29 16 my $self = shift;
30  
31 16 return MaxMind::DB::Reader::Decoder->new(
32 data_source => $self->data_source,
33 pointer_base => $self->_search_tree_size
34 + DATA_SECTION_SEPARATOR_SIZE,
35 );
36 }
37  
38 21 1;
« Reader.pm ↑ Summary