File Coverage

blib/lib/Email/Abstract/MailMessage.pm
Criterion Covered Total %
statement 8 22 36.3
branch n/a
condition n/a
subroutine 4 10 40.0
pod 0 7 0.0
total 12 39 30.7


line stmt bran cond sub pod time code
1 3     3   2466 use strict;
  3         8  
  3         172  
2             package Email::Abstract::MailMessage;
3             # ABSTRACT: Email::Abstract wrapper for Mail::Message
4             $Email::Abstract::MailMessage::VERSION = '3.008';
5 3     3   16 use Email::Abstract::Plugin;
  3         5  
  3         88  
6 3     3   817 BEGIN { @Email::Abstract::MailMessage::ISA = 'Email::Abstract::Plugin' };
7              
8 3     3 0 16 sub target { "Mail::Message" }
9              
10             sub construct {
11 0     0 0   require Mail::Message;
12 0           my ($class, $rfc822) = @_;
13 0           Mail::Message->read($rfc822);
14             }
15              
16             sub get_header {
17 0     0 0   my ($class, $obj, $header) = @_;
18 0           $obj->head->get($header);
19             }
20              
21             sub get_body {
22 0     0 0   my ($class, $obj) = @_;
23 0           $obj->decoded->string;
24             }
25              
26             sub set_header {
27 0     0 0   my ($class, $obj, $header, @data) = @_;
28 0           $obj->head->delete($header);
29 0           $obj->head->add($header, $_) for @data;
30             }
31              
32             sub set_body {
33 0     0 0   my ($class, $obj, $body) = @_;
34 0           $obj->body(Mail::Message::Body->new(data => $body));
35             }
36              
37             sub as_string {
38 0     0 0   my ($class, $obj) = @_;
39 0           $obj->string;
40             }
41              
42             1;
43              
44             #pod =head1 DESCRIPTION
45             #pod
46             #pod This module wraps the Mail::Message mail handling library with an
47             #pod abstract interface, to be used with L
48             #pod
49             #pod =head1 SEE ALSO
50             #pod
51             #pod L, L.
52             #pod
53             #pod =cut
54              
55             __END__