File Coverage

blib/lib/Moonshine/Bootstrap/Component/Abbr.pm
Criterion Covered Total %
statement 17 17 100.0
branch 2 2 100.0
condition 1 2 50.0
subroutine 5 5 100.0
pod 0 1 0.0
total 25 27 92.5


line stmt bran cond sub pod time code
1             package Moonshine::Bootstrap::Component::Abbr;
2              
3 5     5   205505 use strict;
  5         12  
  5         293  
4 5     5   31 use warnings;
  5         12  
  5         463  
5              
6 5     5   513 use Moonshine::Magic;
  5         144995  
  5         36  
7 5     5   2981 use Moonshine::Util;
  5         15  
  5         45  
8              
9             extends 'Moonshine::Bootstrap::Component';
10              
11             has(
12             abbr_spec => sub {
13             {
14             tag => { default => 'abbr' },
15             title => 1,
16             data => 1,
17             initialism => 0,
18             };
19             }
20             );
21              
22             sub abbr {
23 4     4 0 16111 my ($self) = shift;
24              
25 4   50     23 my ( $base_args, $build_args ) = $self->validate_build(
26             {
27             params => $_[0] // {},
28             spec => $self->abbr_spec,
29             }
30             );
31              
32 4 100       26 if ( defined $build_args->{initialism} ) {
33 2         9 $base_args->{class} = append_str( 'initialism', $base_args->{class} );
34             }
35              
36 4         27 return Moonshine::Element->new($base_args);
37             }
38              
39             1;
40              
41             __END__