File Coverage

lib/Mail/AuthenticationResults/Token.pm
Criterion Covered Total %
statement 25 27 100.0
branch n/a
condition n/a
subroutine 8 9 88.8
pod 6 6 100.0
total 39 42 97.6


line stmt bran cond sub pod time code
1             package Mail::AuthenticationResults::Token;
2             # ABSTRACT: Base class for modelling AuthenticationResults Header parts
3              
4             require 5.008;
5 31     31   111671 use strict;
  31         80  
  31         1216  
6 31     31   152 use warnings;
  31         47  
  31         1920  
7             our $VERSION = '2.20260216'; # VERSION
8 31     31   1939 use Carp;
  31         1629  
  31         10084  
9              
10              
11             sub new {
12 1271     1271 1 296935 my ( $class, $header, $args ) = @_;
13              
14 1271         3310 my $self = { 'args' => $args };
15 1271         2064 bless $self, $class;
16              
17 1271         2641 $self->{ 'header' } = $header;
18 1271         3624 $self->parse();
19              
20 1256         2836 return $self;
21             }
22              
23              
24             sub new_from_value {
25 1540     1540 1 5212 my ( $class, $value ) = @_;
26              
27 1540         4217 my $self = { 'value' => $value };
28 1540         3303 bless $self, $class;
29              
30 1540         3766 return $self;
31             }
32              
33              
34             sub value {
35 3718     3718 1 10113 my ( $self ) = @_;
36 3718         11810 return $self->{ 'value' };
37             }
38              
39              
40             sub remainder {
41 1256     1256 1 1943 my ( $self ) = @_;
42 1256         2592 return $self->{ 'header' };
43             }
44              
45              
46             sub parse {
47 1     1 1 3 my ( $self ) = @_;
48 1         25 croak 'parse not implemented';
49             }
50              
51              
52             sub is { # uncoverable subroutine
53             # a base Token cannot be instantiated, and all subclasses should implement this method.
54 0     0 1   my ( $self ) = @_; # uncoverable statement
55 0           croak 'is not implemented'; # uncoverable statement
56             }
57              
58             1;;
59              
60             __END__