Picnic/Result/DeliverySlots.pm

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