| 1 | package Badger::Data::Facet::List::MinSize; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | use Badger::Data::Facet::Class | ||||||||||||||||||||
| 4 | 1 | version => 0.01, | |||||||||||||||||||
| 5 | type => 'list', | ||||||||||||||||||||
| 6 | 1 | ▶ | args => 'min_size'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | sub validate { | ||||||||||||||||||||
| 10 | 3 | ▶ | my ($self, $value, $type) = @_; | ||||||||||||||||||
|
Subroutine
validate: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | return scalar(@$value) >= $self->{ min_size } | ||||||||||||||||||||
| 13 | ? $value | ||||||||||||||||||||
| 14 | : $self->invalid_msg( | ||||||||||||||||||||
| 15 | 3 | ▶ | too_few => $type || 'List', $self->{ min_size }, scalar(@$value) | ||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$type || 'List'
MC/DC0%0/1
$type || 'List'
$type
Truth table50%1/2
A
A= $type
| |||||||||||||||||||||
| 16 | ); | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 1 | 1; | |||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | __END__ | ||||||||||||||||||||