File Coverage

blib/lib/Mail/Message/Field/Unstructured.pm
Criterion Covered Total %
statement 19 19 100.0
branch 5 8 62.5
condition 5 6 83.3
subroutine 5 5 100.0
pod 0 1 0.0
total 34 39 87.1


line stmt bran cond sub pod time code
1             # Copyrights 2001-2022 by [Mark Overmeer ].
2             # For other contributors see ChangeLog.
3             # See the manual pages for details on the licensing terms.
4             # Pod stripped from pm file by OODoc 2.03.
5             # This code is part of distribution Mail-Message. Meta-POD processed with
6             # OODoc into POD and HTML manual-pages. See README.md
7             # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8              
9             package Mail::Message::Field::Unstructured;
10 21     21   684 use vars '$VERSION';
  21         40  
  21         1020  
11             $VERSION = '3.012';
12              
13 21     21   104 use base 'Mail::Message::Field::Full';
  21         42  
  21         2304  
14              
15 21     21   130 use strict;
  21         42  
  21         457  
16 21     21   130 use warnings;
  21         51  
  21         2834  
17              
18              
19             sub init($)
20 7     7 0 14 { my ($self, $args) = @_;
21              
22 7 100 66     36 if($args->{body} && ($args->{encoding} || $args->{charset}))
      100        
23 2         12 { $args->{body} = $self->encode($args->{body}, %$args);
24             }
25 7 50       55 $self->SUPER::init($args) or return;
26              
27             $self->log(WARNING =>"Attributes are not supported for unstructured fields")
28 7 50       19 if defined $args->{attributes};
29              
30             $self->log(WARNING => "No extras for unstructured fields")
31 7 50       17 if defined $args->{extra};
32              
33 7         31 $self;
34             }
35              
36              
37             1;