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.40068'; |
4
|
145
|
|
|
145
|
|
1165
|
use Moose; |
|
145
|
|
|
|
|
387
|
|
|
145
|
|
|
|
|
1090
|
|
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
|
1340
|
|
|
1340
|
0
|
2646
|
my $self = shift; |
25
|
1340
|
|
|
|
|
36664
|
return $self->field_def->fif($self); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub fields_fif { |
29
|
69
|
|
|
69
|
0
|
192
|
my ( $self, $prefix ) = @_; |
30
|
69
|
|
|
|
|
1851
|
return $self->field_def->fields_fif( $self, $prefix ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub render { |
34
|
284
|
|
|
284
|
0
|
597
|
my $self = shift; |
35
|
284
|
|
|
|
|
8421
|
return $self->field_def->render($self); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub peek { |
40
|
14
|
|
|
14
|
0
|
31
|
my ( $self, $indent ) = @_; |
41
|
14
|
|
50
|
|
|
29
|
$indent ||= ''; |
42
|
14
|
50
|
|
|
|
353
|
my $name = $self->field_def ? $self->field_def->full_name : $self->name; |
43
|
14
|
50
|
|
|
|
353
|
my $type = $self->field_def ? $self->field_def->type : 'unknown'; |
44
|
14
|
|
|
|
|
35
|
my $string = $indent . "result " . $name . " type: " . $type . "\n"; |
45
|
14
|
100
|
|
|
|
385
|
$string .= $indent . "....value => " . $self->value . "\n" if $self->has_value; |
46
|
14
|
100
|
|
|
|
437
|
if( $self->has_results ) { |
47
|
4
|
|
|
|
|
9
|
$indent .= ' '; |
48
|
4
|
|
|
|
|
127
|
foreach my $res ( $self->results ) { |
49
|
8
|
|
|
|
|
23
|
$string .= $res->peek( $indent ); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
14
|
|
|
|
|
50
|
return $string; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
56
|
145
|
|
|
145
|
|
795524
|
use namespace::autoclean; |
|
145
|
|
|
|
|
414
|
|
|
145
|
|
|
|
|
1718
|
|
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.40068 |
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) 2017 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 |