File Coverage

blib/lib/Moonshine/Bootstrap/Component/NavbarButton.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition 1 2 50.0
subroutine 2 2 100.0
pod n/a
total 9 10 90.0


line stmt bran cond sub pod time code
1             package Moonshine::Bootstrap::Component::NavbarButton;
2              
3 7     7   163797 use Moonshine::Magic;
  7         115634  
  7         53  
4              
5             extends(
6             'Moonshine::Bootstrap::Component',
7             'Moonshine::Bootstrap::Component::Button',
8             );
9              
10             has(
11             navbar_button_spec => sub {
12             {
13             type => { default => 'button' },
14             switch => { default => 'default', base => 1 },
15             class_base => { default => 'navbar-btn' },
16             data => { default => 'Submit' },
17             alignment => { optional => 1, base => 1 },
18             alignment_base => { default => 'navbar-', base => 1, },
19             };
20             }
21             );
22              
23             sub navbar_button {
24 7     7   30895 my ($self) = shift;
25              
26 7   50     106 my ( $base_args, $build_args ) = $self->validate_build(
27             {
28             params => $_[0] // {},
29             spec => $self->navbar_button_spec,
30             }
31             );
32              
33 7         106 return $self->button($base_args);
34             }
35              
36             1;
37              
38             __END__