| 1 | 6 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 2 | |||||||||||||
| 3 | package HTML::FormFu::Role::Element::NonBlock; | ||||||||||||
| 4 | 6 | $HTML::FormFu::Role::Element::NonBlock::VERSION = '2.09'; | |||||||||||
| 5 | # ABSTRACT: base class for single-tag elements | ||||||||||||
| 6 | |||||||||||||
| 7 | 6 | ▶ | use Moose::Role; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 6 | ▶ | use HTML::FormFu::Util qw( process_attrs ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 6 | has tag => ( is => 'rw', traits => ['Chained'] ); | |||||||||||
| 12 | |||||||||||||
| 13 | 2 | ▶ | after BUILD => sub { | ||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | 2 | my $self = shift; | |||||||||||
| 15 | |||||||||||||
| 16 | 2 | $self->filename('non_block'); | |||||||||||
| 17 | |||||||||||||
| 18 | 2 | return; | |||||||||||
| 19 | 6 | }; | |||||||||||
| 20 | |||||||||||||
| 21 | 3 | ▶ | around render_data_non_recursive => sub { | ||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
| |||||||||||||
| 22 | 3 | my ( $orig, $self, $args ) = @_; | |||||||||||
| 23 | |||||||||||||
| 24 | 3 | ▶ | my $render = $self->$orig( | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | { tag => $self->tag, | ||||||||||||
| 26 | $args ? %$args : (), | ||||||||||||
| 27 | } ); | ||||||||||||
| 28 | |||||||||||||
| 29 | 3 | return $render; | |||||||||||
| 30 | 6 | }; | |||||||||||
| 31 | |||||||||||||
| 32 | 3 | ▶ | sub string { | ||||||||||
|
Subroutine
string: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||||
| 33 | 3 | my ( $self, $args ) = @_; | |||||||||||
| 34 | |||||||||||||
| 35 | 3 | ▶ | $args ||= {}; | ||||||||||
|
Condition50%1/2
$args ||= {}
MC/DC0%0/1
$args ||= {}
$args
Truth table50%1/2
A
A= $args
| |||||||||||||
| 36 | |||||||||||||
| 37 | my $render | ||||||||||||
| 38 | = exists $args->{render_data} | ||||||||||||
| 39 | ? $args->{render_data} | ||||||||||||
| 40 | 3 | ▶ | : $self->render_data; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 41 | |||||||||||||
| 42 | # non_block template | ||||||||||||
| 43 | |||||||||||||
| 44 | my $html = sprintf "<%s%s />", | ||||||||||||
| 45 | $render->{tag}, | ||||||||||||
| 46 | 3 | process_attrs( $render->{attributes} ), | |||||||||||
| 47 | ; | ||||||||||||
| 48 | |||||||||||||
| 49 | 3 | return $html; | |||||||||||
| 50 | } | ||||||||||||
| 51 | |||||||||||||
| 52 | 6 | 1; | |||||||||||
| 53 | |||||||||||||
| 54 | __END__ | ||||||||||||