blib/lib/Langertha/Skeid/CapacityProbe/Custom.pm

filter: Statementstmt 100% 16 / 16 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 95.8% 23 / 24 CC 2 SCAR 3.2
CC
2
Cov
94%
__ANON__
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« lib/Langertha/Skeid/Protocol/Refusal.pm ↑ Summary lib/Langertha/Skeid/Proxy/RelayContent.pm »
1 package Langertha::Skeid::CapacityProbe::Custom;
2 5 our $VERSION = '0.004';
3 # ABSTRACT: Capacity probe backed by a caller-supplied callback
4 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 extends 'Langertha::Skeid::CapacityProbe';
9  
10  
11  
12 has code => (
13 is => 'ro',
14 required => 1,
15 17 ▶ isa => sub { croak 'custom capacity probe needs a coderef' unless ref($_[0]) eq 'CODE' },
Subroutine __ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
unless ref $_[0] eq "CODE" 0 17 17
16 5 );
17  
18  
19 15 ▶sub poll {
Subroutine poll: called CC=1 SCAR=0.0
Pod documented
20 15 my ($self) = @_;
21 15 return $self->code->($self);
22 }
23  
24  
25 5 1;
26  
27 __END__
« lib/Langertha/Skeid/Protocol/Refusal.pm ↑ Summary lib/Langertha/Skeid/Proxy/RelayContent.pm »