blib/lib/Term/Fabulous/Role/HasOptions.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 36 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Term::Fabulous::Role::HasOptions;
2  
3 use v5.32;
4 use warnings;
5 use feature 'signatures';
6 no warnings 'experimental::signatures';
7  
8 our $VERSION = '0.05';
9  
10 use Object::Pad 0.825;
11  
12 use Term::Fabulous::OptionList;
13  
14 role Term::Fabulous::Role::HasOptions {
15  
16 # Reads the options without an argument, replaces them with an array
17 # reference.
18 method options;
19  
20 # The options of a layout come first, so value and selected_index can
21 # name one wherever they stand.
22 method apply_layout_settings (@settings) {
23 my %is_option = ( options => 1, option => 1 );
24 return $self->next::method( ( grep { $is_option{ $_->[0] } } @settings ), ( grep { !$is_option{ $_->[0] } } @settings ) );
25 }
26  
27 # The handler of the 'options' and 'option' layout properties: adds
28 # the options of the node.
29 method add_layout_options ($kid) {
30 return $self->options( [ $self->options, Term::Fabulous::OptionList->from_layout_node( ref $self, $kid ) ] );
31 }
32 }
33  
34 1;
35  
36 __END__