MtPolicyd/Plugin/SetField.pm

filter: Statementstmt 83.3% 15 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 82.6% 19 / 23 CC 1 SCAR 2.2
CC
1
Cov
83%
run
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« MtPolicyd/VirtualHost.pm ↑ Summary MtPolicyd/Connection/Sql.pm »
1 package Mail::MtPolicyd::Plugin::SetField;
2  
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '2.01'; # VERSION
7 # ABSTRACT: mtpolicyd plugin which just sets and key=value in the session
8  
9  
10 1 extends 'Mail::MtPolicyd::Plugin';
11  
12 1 ▶use Mail::MtPolicyd::Plugin::Result;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 has 'key' => ( is => 'rw', isa => 'Str', required => 1 );
15 1 has 'value' => ( is => 'rw', isa => 'Str', required => 1 );
16  
17 sub run {
18 0 ▶ my ( $self, $r ) = @_;
Subroutine run: not called CC=1 SCAR=6.9
Pod documented
19 0 $r->session->{$self->key} = $self->value;
20 0 return;
21 }
22  
23 1 __PACKAGE__->meta->make_immutable;
24  
25 1 1;
26  
27 __END__
28  
29 =pod
30  
31 =encoding UTF-8
32  
33 =head1 NAME
34  
35 Mail::MtPolicyd::Plugin::SetField - mtpolicyd plugin which just sets and key=value in the session
36  
37 =head1 VERSION
38  
39 version 2.01
40  
41 =head1 DESCRIPTION
42  
43 This plugin can be used to set key/values within the session.
44  
45 =head1 EXAMPLE
46  
47 <Plugin set-scanned>
48 module = "SetField"
49 key=mail-is-scanned
50 value=1
51 </Plugin>
52  
53 =head1 AUTHOR
54  
55 Markus Benning <ich@markusbenning.de>
56  
57 =head1 COPYRIGHT AND LICENSE
58  
59 This software is Copyright (c) 2014 by Markus Benning <ich@markusbenning.de>.
60  
61 This is free software, licensed under:
62  
63 The GNU General Public License, Version 2, June 1991
64  
65 =cut
« MtPolicyd/VirtualHost.pm ↑ Summary MtPolicyd/Connection/Sql.pm »