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