File Coverage

blib/lib/Message/Passing/Filter/Mangle.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 16 16 100.0


line stmt bran cond sub pod time code
1             package Message::Passing::Filter::Mangle;
2 1     1   29110 use Moo;
  1         13320  
  1         8  
3 1     1   2515 use MooX::Types::MooseLike::Base qw/ CodeRef /;
  1         5597  
  1         97  
4 1     1   653 use namespace::clean -except => 'meta';
  1         11138  
  1         6  
5              
6             with 'Message::Passing::Role::Filter';
7              
8             has filter_function => (
9             isa => CodeRef,
10             is => 'ro',
11             required => 1,
12             );
13              
14             sub filter {
15 6     6 1 6 my $self = shift;
16              
17 6         21 return $self->filter_function->(@_);
18             }
19              
20             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 minus $self.
31              
32             It's intended for use with L 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             who sponsored its development for its
49             VoIP division called SureVoIP for use with
50             the SureVoIP API -
51            
52              
53             =head1 AUTHOR, COPYRIGHT AND LICENSE
54              
55             See L.
56              
57             =cut