| 1 | package Email::Sender::Transport::Wrapper 2.603; | ||||||||||
| 2 | # ABSTRACT: a mailer to wrap a mailer for mailing mail | ||||||||||
| 3 | |||||||||||
| 4 | 3 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | with 'Email::Sender::Transport'; | |||||||||
| 6 | |||||||||||
| 7 | 3 | ▶ | use Email::Sender::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | #pod =head1 DESCRIPTION | ||||||||||
| 10 | #pod | ||||||||||
| 11 | #pod Email::Sender::Transport::Wrapper wraps a transport, provided as the | ||||||||||
| 12 | #pod C<transport> argument to the constructor. It is provided as a simple way to | ||||||||||
| 13 | #pod use method modifiers to create wrapping classes. | ||||||||||
| 14 | #pod | ||||||||||
| 15 | #pod =cut | ||||||||||
| 16 | |||||||||||
| 17 | 3 | has transport => ( | |||||||||
| 18 | is => 'ro', | ||||||||||
| 19 | does => 'Email::Sender::Transport', | ||||||||||
| 20 | required => 1, | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | 2 | ▶ | sub send_email { | ||||||||
|
Subroutine
send_email: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 24 | 2 | my $self = shift; | |||||||||
| 25 | |||||||||||
| 26 | 2 | $self->transport->send_email(@_); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 2 | ▶ | sub is_simple { | ||||||||
|
Subroutine
is_simple: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 30 | 2 | return $_[0]->transport->is_simple; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub allow_partial_success { | ||||||||
|
Subroutine
allow_partial_success: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 34 | 0 | return $_[0]->transport->allow_partial_success; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 2 | ▶ | sub BUILDARGS { | ||||||||
|
Subroutine
BUILDARGS: called CC=5 SCAR=16.4
Pod
undocumented
| |||||||||||
| 38 | 2 | my $self = shift; | |||||||||
| 39 | 2 | my $href = $self->SUPER::BUILDARGS(@_); | |||||||||
| 40 | |||||||||||
| 41 | 2 | ▶ | if (my $class = delete $href->{transport_class}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | Carp::confess("given both a transport and transport_class") | ||||||||||
| 43 | 1 | ▶ | if $href->{transport}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 44 | |||||||||||
| 45 | 1 | my %arg; | |||||||||
| 46 | 1 | ▶ | for my $key (map {; /^transport_arg_(.+)$/ ? "$1" : () } keys %$href) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | 0 | $arg{$key} = delete $href->{"transport_arg_$key"}; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 1 | $href->{transport} = Email::Sender::Util->easy_transport($class, \%arg); | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 2 | return $href; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 3 | ▶ | no Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 57 | 3 | 1; | |||||||||
| 58 | |||||||||||
| 59 | __END__ | ||||||||||