File Coverage

blib/lib/Data/Validate/CSV/Cell.pm
Criterion Covered Total %
statement 20 27 74.0
branch n/a
condition n/a
subroutine 7 11 63.6
pod 0 1 0.0
total 27 39 69.2


line stmt bran cond sub pod time code
1 1     1   12 use v5.12;
  1         3  
2 1     1   5 use strict;
  1         2  
  1         17  
3 1     1   4 use warnings;
  1         2  
  1         59  
4              
5             package Data::Validate::CSV::Cell;
6              
7             our $AUTHORITY = 'cpan:TOBYINK';
8             our $VERSION = '0.002';
9              
10 1     1   525 use Moo::Role;
  1         17203  
  1         5  
11 1     1   905 use Data::Validate::CSV::Types -types;
  1         4  
  1         13  
12 1     1   6389 use Types::Common::Numeric qw( PositiveInt );
  1         12845  
  1         9  
13 1     1   970 use namespace::autoclean;
  1         14632  
  1         4  
14              
15             requires '_chunk_for_key_string';
16              
17             has raw_value => ( is => 'ro', isa => Str );
18             has row_number => ( is => 'ro', isa => Maybe[PositiveInt] );
19             has col_number => ( is => 'ro', isa => Maybe[PositiveInt] );
20             has row => ( is => 'ro', isa => Object, weaken => !!1 );
21             has col => ( is => 'ro', isa => Object, weaken => !!1, handles => ['datatype'] );
22              
23             has _errors => (
24             is => 'lazy',
25 0     0     builder => sub { [] },
26             );
27              
28 0     0 0   sub errors { $_[0]->value; $_[0]->_errors }
  0            
29              
30             has value => ( is => 'lazy' );
31             has inflated_value => ( is => 'lazy' );
32              
33             sub _build_value {
34 0     0     my $self = shift;
35 0           $self->col->canonicalize_value($self->_errors, $self->raw_value);
36             }
37              
38             sub _build_inflated_value {
39 0     0     my $self = shift;
40 0           $self->col->inflate_value([], $self->raw_value);
41             }
42              
43             1;