| 1 | package Role::TinyCommons::Collection::SelectItems; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Role::Tiny; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||
| 6 | 1 | our $DATE = '2024-01-16'; # DATE | |||||||||
| 7 | 1 | our $DIST = 'Role-TinyCommons-Collection'; # DIST | |||||||||
| 8 | 1 | our $VERSION = '0.010'; # VERSION | |||||||||
| 9 | |||||||||||
| 10 | ### required methods | ||||||||||
| 11 | |||||||||||
| 12 | 1 | requires 'select_items'; | |||||||||
| 13 | |||||||||||
| 14 | ### provided methods | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | sub has_matching_item { | ||||||||
|
Subroutine
has_matching_item: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 17 | 0 | my ($self, %args) = @_; | |||||||||
| 18 | 0 | my @results = $self->select_items(result_limit => 1, %args); | |||||||||
| 19 | 0 | ▶ | @results ? 1:0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub select_first { | ||||||||
|
Subroutine
select_first: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 23 | 0 | my ($self, %args) = @_; | |||||||||
| 24 | 0 | my @results = $self->select_items(result_limit => 1, %args); | |||||||||
| 25 | 0 | ▶ | @results ? $results[0] : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 1 | 1; | |||||||||
| 29 | # ABSTRACT: The search_items() interface | ||||||||||
| 30 | |||||||||||
| 31 | __END__ | ||||||||||