File Coverage

blib/lib/Moonshine/Bootstrap/Component/MediaLinkImage.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition 1 2 50.0
subroutine 4 4 100.0
pod n/a
total 18 19 94.7


line stmt bran cond sub pod time code
1             package Moonshine::Bootstrap::Component::MediaLinkImage;
2              
3 8     8   231739 use Moonshine::Magic;
  8         112389  
  8         71  
4 8     8   4983 use Params::Validate qw/HASHREF/;
  8         23  
  8         770  
5 8     8   63 use Moonshine::Util;
  8         21  
  8         91  
6              
7             extends (
8             'Moonshine::Bootstrap::Component',
9             'Moonshine::Bootstrap::Component::LinkImage',
10             );
11              
12             has(
13             media_link_image_spec => sub {
14             {
15             img => { base => 1, type => HASHREF },
16             href => 1,
17             };
18             }
19             );
20              
21             sub media_link_image {
22 12     12   22338 my ($self) = shift;
23              
24 12   50     146 my ( $base_args, $build_args ) = $self->validate_build(
25             {
26             params => $_[0] // {},
27             spec => $self->media_link_image_spec,
28             }
29             );
30              
31 12         147 $base_args->{img}->{class} = append_str('media-object', $base_args->{img}->{class});
32 12         204 return $self->link_image($base_args);
33             }
34              
35             1;
36              
37             __END__