Passing/Role/Input.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 32 / 32 SCAR 11.0
CC
3
Cov
100%
__ANON__
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 3.0
« Passing/Role/HasAConnection.pm ↑ Summary Passing/Output/Socket/UDP.pm »
1 package Message::Passing::Role::Input;
2 14 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 14 ▶use Scalar::Util qw/ blessed /;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 14 ▶use Module::Runtime qw/ require_module /;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 14 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 has output_to => (
8 is => 'ro',
9 required => 1,
10 37 ▶ isa => sub { blessed($_[0]) && $_[0]->can('consume') },
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_[0]) and $_[0]->can("consume") 35 2 37
11 coerce => sub {
12 37 ▶ my $val = shift;
Subroutine __ANON__: called CC=2 SCAR=6.9
13 37 ▶ if (ref($val) eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $val eq "HASH") 1 36 37
14 1 my %stuff = %$val;
15 1 my $class = delete($stuff{class});
16 1 require_module($class);
17 1 $val = $class->new(%stuff);
18 }
19 37 $val;
20 },
21 14 );
22  
23 14 1;
24  
25 =head1 NAME
26  
27 Message::Passing::Role::Input
28  
29 =head1 DESCRIPTION
30  
31 Produces messages.
32  
33 =head1 ATTRIBUTES
34  
35 =head2 output_to
36  
37 Required, must perform the L<Message::Passing::Role::Output> role.
38  
39 =head1 SEE ALSO
40  
41 =over
42  
43 =item L<Message::Passing>
44  
45 =item L<Message::Passing::Manual::Concepts>
46  
47 =back
48  
49 =head1 SPONSORSHIP
50  
51 This module exists due to the wonderful people at Suretec Systems Ltd.
52 <http://www.suretecsystems.com/> who sponsored its development for its
53 VoIP division called SureVoIP <http://www.surevoip.co.uk/> for use with
54 the SureVoIP API -
55 <http://www.surevoip.co.uk/support/wiki/api_documentation>
56  
57 =head1 AUTHOR, COPYRIGHT AND LICENSE
58  
59 See L<Message::Passing>.
60  
61 =cut
« Passing/Role/HasAConnection.pm ↑ Summary Passing/Output/Socket/UDP.pm »