FromMail/Object.pm untested

filter: Statementstmt 0.0% 0 / 33 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 57 SCAR 30.0
CC
4
Cov
0%
settings
12.0
init
6.0
topic
2.0
CRAP 20.0
1 # Copyrights 2003-2018 by [Mark Overmeer <markov@cpan.org>].
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 HTML-FromMail. 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 HTML::FromMail::Object;
10 use vars '$VERSION';
11 $VERSION = '0.12';
12  
13 use base 'Mail::Reporter';
14  
15 use strict;
16 use warnings;
17  
18  
19 sub init($)
20 { my ($self, $args) = @_;
21  
22 $self->SUPER::init($args) or return;
23  
24 unless(defined($self->{HFO_topic} = $args->{topic}))
25 { $self->log(INTERNAL => 'No topic defined for '.ref($self));
26 exit 1;
27 }
28  
29 $self->{HFO_settings} = $args->{settings} || {};
30 $self;
31 }
32  
33  
34 sub topic() { shift->{HFO_topic} }
35  
36  
37 sub settings(;$)
38 { my $self = shift;
39 my $topic = @_ ? shift : $self->topic;
40 return {} unless defined $topic;
41 $self->{HFO_settings}{$topic} || {};
42 }
43  
44  
45 sub plain2html($)
46 { my $self = shift;
47 my $string = join '', @_;
48 for($string)
49 { s/\&/\&amp;/g;
50 s/\</\&lt;/g;
51 s/\>/\&gt;/g;
52 s/"/\&quot;/g;
53 }
54 $string;
55 }
56  
57 1;