line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
25
|
|
|
25
|
|
19353
|
use strict; |
|
25
|
|
|
|
|
71
|
|
|
25
|
|
|
|
|
1753
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTML::FormFu::Role::Element::MultiElement; |
4
|
|
|
|
|
|
|
# ABSTRACT: multi-element role |
5
|
|
|
|
|
|
|
$HTML::FormFu::Role::Element::MultiElement::VERSION = '2.07'; |
6
|
25
|
|
|
25
|
|
166
|
use Moose::Role; |
|
25
|
|
|
|
|
60
|
|
|
25
|
|
|
|
|
253
|
|
7
|
|
|
|
|
|
|
|
8
|
25
|
|
|
25
|
|
141036
|
use Carp qw( croak ); |
|
25
|
|
|
|
|
62
|
|
|
25
|
|
|
|
|
8699
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub nested_names { |
11
|
2030
|
|
|
2030
|
0
|
3749
|
my ($self) = @_; |
12
|
|
|
|
|
|
|
|
13
|
2030
|
50
|
|
|
|
4357
|
croak 'cannot set nested_names' if @_ > 1; |
14
|
|
|
|
|
|
|
|
15
|
2030
|
50
|
|
|
|
4414
|
if ( defined $self->name ) { |
16
|
2030
|
|
|
|
|
3228
|
my @names; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# ignore immediate parent |
19
|
2030
|
|
|
|
|
5182
|
my $parent = $self->parent; |
20
|
|
|
|
|
|
|
|
21
|
2030
|
|
|
|
|
4960
|
while ( defined( $parent = $parent->parent ) ) { |
22
|
|
|
|
|
|
|
|
23
|
2630
|
50
|
66
|
|
|
30843
|
if ( $parent->can('is_field') && $parent->is_field ) { |
|
|
100
|
100
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# handling Field |
26
|
0
|
0
|
|
|
|
0
|
push @names, $parent->name |
27
|
|
|
|
|
|
|
if defined $parent->name; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
elsif ( $parent->can('is_repeatable') && $parent->is_repeatable ) { |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# handling Repeatable |
32
|
|
|
|
|
|
|
# ignore Repeatables nested_name attribute as it is provided |
33
|
|
|
|
|
|
|
# by the childrens Block elements |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
else { |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# handling 'not Field' and 'not Repeatable' |
38
|
2564
|
100
|
|
|
|
69893
|
push @names, $parent->nested_name |
39
|
|
|
|
|
|
|
if defined $parent->nested_name; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
2030
|
100
|
|
|
|
5144
|
if (@names) { |
44
|
312
|
|
|
|
|
964
|
return reverse(@names), $self->name; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
1718
|
|
|
|
|
4599
|
return ( $self->name ); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub nested_base { |
52
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
53
|
|
|
|
|
|
|
|
54
|
0
|
0
|
|
|
|
|
croak 'cannot set nested_base' if @_ > 1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# ignore immediate parent |
57
|
0
|
|
|
|
|
|
my $parent = $self->parent; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
while ( defined( $parent = $parent->parent ) ) { |
60
|
|
|
|
|
|
|
|
61
|
0
|
0
|
|
|
|
|
return $parent->nested_name if defined $parent->nested_name; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=pod |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=encoding UTF-8 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 NAME |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
HTML::FormFu::Role::Element::MultiElement - multi-element role |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 VERSION |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
version 2.07 |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 AUTHOR |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Carl Franks <cpan@fireartist.com> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This software is copyright (c) 2018 by Carl Franks. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
90
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |