File Coverage

blib/lib/Moonshine/Bootstrap/Component/Input.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition 2 2 100.0
subroutine 5 5 100.0
pod n/a
total 22 22 100.0


line stmt bran cond sub pod time code
1             package Moonshine::Bootstrap::Component::Input;
2              
3 11     11   227989 use strict;
  11         31  
  11         620  
4 11     11   73 use warnings;
  11         24  
  11         799  
5              
6 11     11   624 use Moonshine::Magic;
  11         124650  
  11         104  
7 11     11   6918 use Moonshine::Bootstrap::Component;
  11         36  
  11         486  
8              
9             extends 'Moonshine::Bootstrap::Component';
10              
11             has(
12             input_spec => sub {
13             {
14             tag => { default => 'input' },
15             class_base => { default => 'form-control' },
16             type => { default => 'text' },
17             };
18             }
19             );
20              
21             sub input {
22 29     29   13205 my ($self) = shift;
23              
24 29   100     282 my ( $base_args, $build_args ) = $self->validate_build(
25             {
26             params => $_[0] // {},
27             spec => $self->input_spec,
28             }
29             );
30 29         333 return Moonshine::Element->new($base_args);
31             }
32              
33             1;
34              
35             __END__