has
(
embed_responsive_spec
=>
sub
{
{
tag
=> {
default
=>
'div'
},
class_base
=> {
default
=>
'embed-responsive'
},
ratio
=> {
optional
=> 1 },
ratio_base
=> {
default
=>
'embed-responsive-'
},
};
}
);
sub
embed_responsive {
my
(
$self
) =
shift
;
my
(
$base_args
,
$build_args
) =
$self
->validate_build(
{
params
=>
$_
[0] // {},
spec
=>
$self
->embed_responsive_spec,
}
);
if
(
my
$ratio
=
join_class(
$build_args
->{ratio_base},
$build_args
->{ratio} ) )
{
$base_args
->{class} = prepend_str(
$ratio
,
$base_args
->{class} );
}
return
Moonshine::Element->new(
$base_args
);
}
1;