File Coverage

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


line stmt bran cond sub pod time code
1             package Moonshine::Bootstrap::Component::Jumbotron;
2              
3 5     5   175088 use Moonshine::Magic;
  5         133909  
  5         49  
4              
5             lazy_components qw/div h1 p span/;
6              
7             extends (
8             'Moonshine::Bootstrap::Component',
9             'Moonshine::Bootstrap::Component::Button',
10             );
11              
12             has(
13             jumbotron_spec => sub {
14             {
15             tag => { default => 'div' },
16             class_base => { default => 'jumbotron' },
17             full_width => 0,
18             };
19             }
20             );
21              
22             sub jumbotron {
23 7     7   37023 my ($self) = shift;
24              
25 7   100     71 my ( $base_args, $build_args ) = $self->validate_build(
26             {
27             params => $_[0] // {},
28             spec => $self->jumbotron_spec,
29             }
30             );
31              
32 7         97 my $base_element = Moonshine::Element->new($base_args);
33              
34 7 100       18386 if ( defined $build_args->{full_width} ) {
35 2         19 $base_element->add_child( $self->div( { class => 'container' } ) );
36             }
37              
38 7         5130 return $base_element;
39             }
40              
41             1;
42              
43             __END__