line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormHandler::Field::Result; |
2
|
|
|
|
|
|
|
# ABSTRACT: result class for fields |
3
|
|
|
|
|
|
|
$HTML::FormHandler::Field::Result::VERSION = '0.40067'; |
4
|
143
|
|
|
143
|
|
598
|
use Moose; |
|
143
|
|
|
|
|
211
|
|
|
143
|
|
|
|
|
842
|
|
5
|
|
|
|
|
|
|
with 'HTML::FormHandler::Result::Role'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'value' => ( |
9
|
|
|
|
|
|
|
is => 'ro', |
10
|
|
|
|
|
|
|
writer => '_set_value', |
11
|
|
|
|
|
|
|
clearer => '_clear_value', |
12
|
|
|
|
|
|
|
predicate => 'has_value', |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'field_def' => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
isa => 'HTML::FormHandler::Field', |
18
|
|
|
|
|
|
|
writer => '_set_field_def', |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has 'missing' => ( is => 'rw', isa => 'Bool' ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub fif { |
24
|
1334
|
|
|
1334
|
0
|
2098
|
my $self = shift; |
25
|
1334
|
|
|
|
|
33231
|
return $self->field_def->fif($self); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub fields_fif { |
29
|
69
|
|
|
69
|
0
|
96
|
my ( $self, $prefix ) = @_; |
30
|
69
|
|
|
|
|
1726
|
return $self->field_def->fields_fif( $self, $prefix ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub render { |
34
|
282
|
|
|
282
|
0
|
312
|
my $self = shift; |
35
|
282
|
|
|
|
|
7356
|
return $self->field_def->render($self); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub peek { |
40
|
14
|
|
|
14
|
0
|
26
|
my ( $self, $indent ) = @_; |
41
|
14
|
|
50
|
|
|
25
|
$indent ||= ''; |
42
|
14
|
50
|
|
|
|
418
|
my $name = $self->field_def ? $self->field_def->full_name : $self->name; |
43
|
14
|
50
|
|
|
|
436
|
my $type = $self->field_def ? $self->field_def->type : 'unknown'; |
44
|
14
|
|
|
|
|
27
|
my $string = $indent . "result " . $name . " type: " . $type . "\n"; |
45
|
14
|
100
|
|
|
|
470
|
$string .= $indent . "....value => " . $self->value . "\n" if $self->has_value; |
46
|
14
|
100
|
|
|
|
509
|
if( $self->has_results ) { |
47
|
4
|
|
|
|
|
6
|
$indent .= ' '; |
48
|
4
|
|
|
|
|
188
|
foreach my $res ( $self->results ) { |
49
|
8
|
|
|
|
|
32
|
$string .= $res->peek( $indent ); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
14
|
|
|
|
|
39
|
return $string; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
56
|
143
|
|
|
143
|
|
446291
|
use namespace::autoclean; |
|
143
|
|
|
|
|
223
|
|
|
143
|
|
|
|
|
1421
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=pod |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=encoding UTF-8 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 NAME |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
HTML::FormHandler::Field::Result - result class for fields |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 VERSION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
version 0.40067 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SYNOPSIS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Result class for L<HTML::FormHandler::Field> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 AUTHOR |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
FormHandler Contributors - see HTML::FormHandler |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Gerda Shank. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
86
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |