| 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') || []
MC/DC0%0/1
$self->_get('delivery_slots') || []
$self->_get('delivery_slots')
Truth table50%1/2
A
A= $self->_get('delivery_slots')
| |||||||||||||
| 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__ | ||||||||||||