File Coverage

blib/lib/Email/Sender/Transport.pm
Criterion Covered Total %
statement 9 10 90.0
branch 2 2 100.0
condition n/a
subroutine 3 4 75.0
pod 0 2 0.0
total 14 18 77.7


line stmt bran cond sub pod time code
1             package Email::Sender::Transport 2.600;
2             # ABSTRACT: a role for email transports
3              
4 12     12   170972 use Moo::Role;
  12         41043  
  12         66  
5              
6             #pod =head1 DESCRIPTION
7             #pod
8             #pod Email::Sender::Transport is a Moo role to aid in writing classes used to send
9             #pod mail. For the most part, its behavior comes entirely from the role
10             #pod L, which it includes. The important
11             #pod difference is that Transports are often intended to be used by
12             #pod L, and they provide two methods related to that purpose.
13             #pod
14             #pod =for Pod::Coverage is_simple allow_partial_success
15             #pod
16             #pod First, they provide an C method which returns true or
17             #pod false to indicate whether the transport will ever signal partial success.
18             #pod
19             #pod Second, they provide an C method, which returns true if the
20             #pod transport is suitable for use with Email::Sender::Simple. By default, this
21             #pod method returns the inverse of C.
22             #pod
23             #pod It is B that these methods be accurate to prevent
24             #pod Email::Sender::Simple users from sending partially successful transmissions.
25             #pod Partial success is a complex case that almost all users will wish to avoid at
26             #pod all times.
27             #pod
28             #pod =cut
29              
30             with 'Email::Sender::Role::CommonSending';
31              
32             sub is_simple {
33 8     8 0 72 my ($self) = @_;
34 8 100       34 return if $self->allow_partial_success;
35 7         22 return 1;
36             }
37              
38 0     0 0   sub allow_partial_success { 0 }
39              
40 12     12   4328 no Moo::Role;
  12         150  
  12         59  
41             1;
42              
43             __END__