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-2021 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.02.
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   935 use vars '$VERSION';
  21         56  
  21         1285  
11             $VERSION = '3.011';
12              
13 21     21   127 use base 'Mail::Message::Field::Full';
  21         45  
  21         2725  
14              
15 21     21   165 use strict;
  21         46  
  21         665  
16 21     21   133 use warnings;
  21         48  
  21         3427  
17              
18              
19             sub init($)
20 7     7 0 20 { my ($self, $args) = @_;
21              
22 7 100 66     67 if($args->{body} && ($args->{encoding} || $args->{charset}))
      100        
23 2         25 { $args->{body} = $self->encode($args->{body}, %$args);
24             }
25 7 50       37 $self->SUPER::init($args) or return;
26              
27             $self->log(WARNING =>"Attributes are not supported for unstructured fields")
28 7 50       30 if defined $args->{attributes};
29              
30             $self->log(WARNING => "No extras for unstructured fields")
31 7 50       25 if defined $args->{extra};
32              
33 7         52 $self;
34             }
35              
36              
37             1;