IProto/Request.pm

filter: Statementstmt 76.9% 10 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 2 / 5 Podpod 100% 2 / 2 totaltotal 70.0% 14 / 20 CC 1 SCAR 4.7
CC
1
Cov
77%
key
2.0
retry
2.0
_build_data
2.0
CRAP 1.6
« IProto/Connection.pm ↑ Summary IProto/Error.pm »
1 package MR::IProto::Request;
2  
3 =head1 NAME
4  
5 MR::IProto::Request - request message
6  
7 =head1 DESCRIPTION
8  
9 Base class for all request messages.
10  
11 =cut
12  
13 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 extends 'MR::IProto::Message';
15  
16 1 has '+data' => (
17 lazy_build => 1,
18 );
19  
20 =head1 PUBLIC METHODS
21  
22 =over
23  
24 =item key
25  
26 Returns key value.
27 You must reimplement this method in your subclass to use this feature.
28  
29 =cut
30  
31 0 ▶sub key {
Subroutine key: not called CC=1 SCAR=6.9
Pod documented
32 0 return undef;
33 }
34  
35 =item retry
36  
37 If request retry is allowed.
38  
39 =cut
40  
41 0 ▶sub retry {
Subroutine retry: not called CC=1 SCAR=6.9
Pod documented
42 0 return 0;
43 }
44  
45 =back
46  
47 =head1 PROTECTED METHODS
48  
49 =over
50  
51 =item key_attr
52  
53 Class method which must return name of key attribute.
54  
55 =item _build_data
56  
57 You B<must> implement this method in you subclass to pack your object.
58 Returns packed data.
59  
60 =cut
61  
62 0 ▶sub _build_data {
Subroutine _build_data: not called CC=1 SCAR=6.9
63 0 return '';
64 }
65  
66 =back
67  
68 =cut
69  
70 1 ▶no Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
71 1 __PACKAGE__->meta->make_immutable();
72  
73 1 1;
« IProto/Connection.pm ↑ Summary IProto/Error.pm »