File Coverage

blib/lib/Moonshine/Bootstrap/Component/EmbedRes.pm
Criterion Covered Total %
statement 23 23 100.0
branch n/a
condition 1 2 50.0
subroutine 7 7 100.0
pod n/a
total 31 32 96.8


line stmt bran cond sub pod time code
1             package Moonshine::Bootstrap::Component::EmbedRes;
2              
3 5     5   163291 use strict;
  5         14  
  5         201  
4 5     5   23 use warnings;
  5         25  
  5         270  
5              
6 5     5   524 use Moonshine::Magic;
  5         130198  
  5         31  
7 5     5   4495 use Moonshine::Util;
  5         16  
  5         46  
8 5     5   5640 use Method::Traits qw[ Moonshine::Bootstrap::Trait::Export ];
  5         23990  
  5         35  
9              
10             extends(
11             'Moonshine::Bootstrap::Component',
12             'Moonshine::Bootstrap::Component::EmbedResponsive',
13             'Moonshine::Bootstrap::Component::EmbedResponsiveIframe',
14             );
15              
16             has(
17             embed_res_spec => sub {
18             return { iframe => 1, };
19             }
20             );
21              
22             sub embed_res : Export {
23 3     3   7922 my ($self) = shift;
24              
25 3   50     32 my ( $base_args, $build_args ) = $self->validate_build(
26             {
27             params => $_[0] // {},
28             spec => $self->embed_res_spec,
29             }
30             );
31              
32 3         48 my $base = $self->embed_responsive($base_args);
33 3         7613 $base->add_child( $self->embed_responsive_iframe( $build_args->{iframe} ) );
34 3         7813 return $base;
35 5     5   2103 }
  5         11  
  5         41  
36              
37             1;
38              
39             __END__