File Coverage

blib/lib/Role/TinyCommons/Collection/PickItems.pm
Criterion Covered Total %
statement 3 6 50.0
branch 0 2 0.0
condition n/a
subroutine 1 2 50.0
pod 1 1 100.0
total 5 11 45.4


line stmt bran cond sub pod time code
1             package Role::TinyCommons::Collection::PickItems;
2              
3 4     4   323864 use Role::Tiny;
  4         7587  
  4         45  
4              
5             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
6             our $DATE = '2024-01-16'; # DATE
7             our $DIST = 'Role-TinyCommons-Collection'; # DIST
8             our $VERSION = '0.010'; # VERSION
9              
10             ### required methods
11              
12             requires 'pick_items';
13              
14             ### provided methods
15              
16             sub pick_item {
17 0     0 1   my ($self, %args) = @_;
18 0           my @items = $self->pick_items(n => 1, %args);
19 0 0         @items ? $items[0] : undef;
20             }
21              
22             1;
23             # ABSTRACT: The pick_items() interface
24              
25             __END__