File Coverage

blib/lib/Moonshine/Bootstrap/Component/SubmitButton.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::SubmitButton;
2              
3 9     9   211343 use Moonshine::Magic;
  9         209302  
  9         92  
4              
5             extends (
6             'Moonshine::Bootstrap::Component',
7             'Moonshine::Bootstrap::Component::Button',
8             );
9              
10             has(
11             submit_button_spec => sub {
12             {
13             type => { default => 'submit' },
14             switch => { default => 'default', base => 1 },
15             data => { default => 'Submit' }
16             };
17             }
18             );
19              
20             sub submit_button {
21 14     14   9528 my ($self) = shift;
22              
23 14   50     173 my ( $base_args, $build_args ) = $self->validate_build(
24             {
25             params => $_[0] // {},
26             spec => $self->submit_button_spec,
27             }
28             );
29              
30 14         342 return $self->button($base_args);
31             }
32              
33             1;
34              
35             __END__