| 1 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | package Email::Abstract::MIMEEntity; | ||||||||||
| 3 | # ABSTRACT: Email::Abstract wrapper for MIME::Entity | ||||||||||
| 4 | 3 | $Email::Abstract::MIMEEntity::VERSION = '3.010'; | |||||||||
| 5 | 3 | ▶ | use Email::Abstract::Plugin; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 3 | ▶ | BEGIN { @Email::Abstract::MIMEEntity::ISA = 'Email::Abstract::MailInternet' }; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 3 | my $is_avail; | |||||||||
| 9 | 4 | ▶ | sub is_available { | ||||||||
|
Subroutine
is_available: called CC=3 SCAR=11.8
Pod
documented
| |||||||||||
| 10 | 4 | ▶ | return $is_avail if defined $is_avail; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | 0 | eval { require MIME::Entity; MIME::Entity->VERSION(5.508); 1 }; | |||||||||
| 12 | 3 | ▶ | return $is_avail = $@ ? 0 : 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | sub target { "MIME::Entity" } | ||||||||
|
Subroutine
target: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | sub construct { | ||||||||
|
Subroutine
construct: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 18 | 0 | require MIME::Parser; | |||||||||
| 19 | 0 | my $parser = MIME::Parser->new; | |||||||||
| 20 | 0 | $parser->output_to_core(1); | |||||||||
| 21 | 0 | my ($class, $rfc822) = @_; | |||||||||
| 22 | 0 | $parser->parse_data($rfc822); | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub get_body { | ||||||||
|
Subroutine
get_body: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 26 | 0 | my ($self, $obj) = @_; | |||||||||
| 27 | 0 | my $handle = $obj->bodyhandle; | |||||||||
| 28 | 0 | ▶ | return $handle ? $handle->as_string : join('', @{ $obj->body }); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | sub set_body { | ||||||||
|
Subroutine
set_body: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 32 | 0 | my ($class, $obj, $body) = @_; | |||||||||
| 33 | 0 | my @lines = split /\n/, $body; | |||||||||
| 34 | 0 | my $io = $obj->bodyhandle->open("w"); | |||||||||
| 35 | 0 | foreach (@lines) { $io->print($_."\n") } | |||||||||
| 36 | 0 | $io->close; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 3 | 1; | |||||||||
| 40 | |||||||||||
| 41 | #pod =head1 DESCRIPTION | ||||||||||
| 42 | #pod | ||||||||||
| 43 | #pod This module wraps the MIME::Entity mail handling library with an | ||||||||||
| 44 | #pod abstract interface, to be used with L<Email::Abstract> | ||||||||||
| 45 | #pod | ||||||||||
| 46 | #pod =head1 SEE ALSO | ||||||||||
| 47 | #pod | ||||||||||
| 48 | #pod L<Email::Abstract>, L<MIME::Entity>. | ||||||||||
| 49 | #pod | ||||||||||
| 50 | #pod =cut | ||||||||||
| 51 | |||||||||||
| 52 | __END__ | ||||||||||