File Coverage

lib/Mail/AuthenticationResults/Token/Assignment.pm
Criterion Covered Total %
statement 24 24 100.0
branch 2 2 100.0
condition 6 6 100.0
subroutine 6 6 100.0
pod 2 2 100.0
total 40 40 100.0


line stmt bran cond sub pod time code
1             package Mail::AuthenticationResults::Token::Assignment;
2             # ABSTRACT: Class for modelling AuthenticationResults Header parts detected as assignments
3              
4             require 5.008;
5 31     31   597 use strict;
  31         53  
  31         1237  
6 31     31   184 use warnings;
  31         370  
  31         2521  
7             our $VERSION = '2.20260216'; # VERSION
8 31     31   293 use Carp;
  31         139  
  31         2164  
9              
10 31     31   262 use base 'Mail::AuthenticationResults::Token';
  31         99  
  31         10974  
11              
12              
13             sub is {
14 1894     1894 1 3085 my ( $self ) = @_;
15 1894         4877 return 'assignment';
16             }
17              
18             sub parse {
19 360     360 1 680 my ($self) = @_;
20              
21 360         619 my $header = $self->{ 'header' };
22 360         513 my $value = q{};
23              
24 360         5686 my $first = substr( $header,0,1 );
25 360 100 100     1107 if ( $first ne '=' && $first ne '.' && $first ne '/' ) {
      100        
26 1         26 croak 'not an assignment';
27             }
28              
29 359         902 $header = substr( $header,1 );
30              
31 359         778 $self->{ 'value' } = $first;
32 359         681 $self->{ 'header' } = $header;
33              
34 359         674 return;
35             }
36              
37             1;
38              
39             __END__