File Coverage

blib/lib/Moonshine/Bootstrap/Component/LinkedLi.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition 1 2 50.0
subroutine 2 2 100.0
pod n/a
total 11 12 91.6


line stmt bran cond sub pod time code
1             package Moonshine::Bootstrap::Component::LinkedLi;
2              
3 19     19   231466 use Moonshine::Magic;
  19         113722  
  19         149  
4              
5             extends 'Moonshine::Bootstrap::Component';
6              
7             has(
8             linked_li_spec => sub {
9             {
10             tag => { default => 'li' },
11             link => 1,
12             data => { build => 1 },
13             };
14             }
15             );
16              
17             sub linked_li {
18 179     179   25761 my ($self) = shift;
19              
20 179   50     1266 my ( $base_args, $build_args ) = $self->validate_build(
21             {
22             params => $_[0] // {},
23             spec => $self->linked_li_spec,
24             }
25             );
26              
27 179         2248 my $base_element = Moonshine::Element->new($base_args);
28              
29             $base_element->add_child(
30             {
31             tag => 'a',
32             href => $build_args->{link},
33             data => $build_args->{data},
34             }
35 179         437309 );
36              
37 179         429165 return $base_element;
38             }
39              
40             1;
41              
42             __END__