Picnic/Result/DeliverySlots.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 93.3% 28 / 30 CC 2 SCAR 2.9
CC
2
Cov
95%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Picnic/Result/DeliverySlot.pm ↑ Summary
1 package WWW::Picnic::Result::DeliverySlots;
2 # ABSTRACT: Collection of Picnic delivery slots
3 2 our $VERSION = '0.101';
4 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 extends 'WWW::Picnic::Result';
7  
8 2 ▶use WWW::Picnic::Result::DeliverySlot;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 has delivery_slots => (
12 is => 'ro',
13 lazy => 1,
14 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
15 1 my $self = shift;
16 1 ▶ my $slots = $self->_get('delivery_slots') || [];
Condition50%1/2
$self->_get('delivery_slots') || []
l!l
10
MC/DC0%0/1
$self->_get('delivery_slots') || []
$self->_get('delivery_slots')
Truth table50%1/2
A
A= $self->_get('delivery_slots')
Aresult
11
00
17 1 return [ map { WWW::Picnic::Result::DeliverySlot->new($_) } @$slots ];
18 },
19 2 );
20  
21  
22 3 ▶sub all_slots {
Subroutine all_slots: called CC=1 SCAR=0.0
Pod documented
23 3 my ( $self ) = @_;
24 3 return @{ $self->delivery_slots };
25 }
26  
27  
28 2 ▶sub available_slots {
Subroutine available_slots: called CC=1 SCAR=0.0
Pod documented
29 2 my ( $self ) = @_;
30 2 return grep { $_->is_available } $self->all_slots;
31 }
32  
33  
34 2 1;
35  
36 __END__
« Picnic/Result/DeliverySlot.pm ↑ Summary