Passing/Filter/Mangle.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 19 / 19 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Passing/Filter/Encoder/Null.pm ↑ Summary Passing/Filter/Null.pm »
1 package Message::Passing::Filter::Mangle;
2 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use MooX::Types::MooseLike::Base qw/ CodeRef /;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 with 'Message::Passing::Role::Filter';
7  
8 1 has filter_function => (
9 isa => CodeRef,
10 is => 'ro',
11 required => 1,
12 );
13  
14 sub filter {
15 6 ▶ my $self = shift;
Subroutine filter: called CC=1 SCAR=0.0
Pod documented
16  
17 6 return $self->filter_function->(@_);
18 }
19  
20 1 1;
21  
22 =head1 NAME
23  
24 Message::Passing::Filter::Mangle - Filter and/or mangle messages the way you
25 want.
26  
27 =head1 DESCRIPTION
28  
29 This filter takes a sub which is called with the same arguments as
30 L<Message::Passing::Role::Filter/filter> minus $self.
31  
32 It's intended for use with L<Message::Passing::DSL> when you don't want to write
33 a named filter.
34  
35 =head1 ATTRIBUTES
36  
37 =head2 filter_function
38  
39 =head1 METHODS
40  
41 =head2 filter
42  
43 Calls filter_function passing on all received arguments but $self.
44  
45 =head1 SPONSORSHIP
46  
47 This module exists due to the wonderful people at Suretec Systems Ltd.
48 <http://www.suretecsystems.com/> who sponsored its development for its
49 VoIP division called SureVoIP <http://www.surevoip.co.uk/> for use with
50 the SureVoIP API -
51 <http://www.surevoip.co.uk/support/wiki/api_documentation>
52  
53 =head1 AUTHOR, COPYRIGHT AND LICENSE
54  
55 See L<Message::Passing>.
56  
57 =cut
« Passing/Filter/Encoder/Null.pm ↑ Summary Passing/Filter/Null.pm »