line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SyForm::Results; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
6
|
|
|
6
|
|
3862
|
$SyForm::Results::AUTHORITY = 'cpan:GETTY'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: Results of the processing of SyForm::Values |
6
|
|
|
|
|
|
|
$SyForm::Results::VERSION = '0.103'; |
7
|
6
|
|
|
6
|
|
66
|
use Moo; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
34
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with qw( |
10
|
|
|
|
|
|
|
MooX::Traits |
11
|
|
|
|
|
|
|
SyForm::ResultsRole::Success |
12
|
|
|
|
|
|
|
SyForm::ResultsRole::Verify |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has values => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
required => 1, |
18
|
|
|
|
|
|
|
handles => [qw( |
19
|
|
|
|
|
|
|
syform |
20
|
|
|
|
|
|
|
field |
21
|
|
|
|
|
|
|
field_names |
22
|
|
|
|
|
|
|
)], |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has results => ( |
26
|
|
|
|
|
|
|
is => 'ro', |
27
|
|
|
|
|
|
|
required => 1, |
28
|
|
|
|
|
|
|
); |
29
|
2
|
|
|
2
|
0
|
16
|
sub as_hashref { $_[0]->results } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has view => ( |
32
|
|
|
|
|
|
|
is => 'lazy', |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub _build_view { |
36
|
8
|
|
|
8
|
|
107
|
my ( $self, %args ) = @_; |
37
|
8
|
|
|
|
|
15
|
my $view; |
38
|
8
|
|
|
|
|
18
|
eval { |
39
|
8
|
|
|
|
|
14
|
my %view_args; |
40
|
8
|
|
|
|
|
133
|
for my $field ($self->syform->fields->Values) { |
41
|
29
|
|
|
|
|
508
|
my %field_view_args = $field->view_args_by_results($self); |
42
|
29
|
|
|
|
|
63
|
$view_args{$_} = $field_view_args{$_} for keys %field_view_args; |
43
|
|
|
|
|
|
|
} |
44
|
8
|
|
|
|
|
39
|
$view = $self->create_view( %view_args ); |
45
|
|
|
|
|
|
|
}; |
46
|
8
|
50
|
|
|
|
10444
|
SyForm->throw( UnknownErrorOnResultsBuildView => $self, $@ ) if $@; |
47
|
8
|
|
|
|
|
59
|
return $view; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub create_view { |
51
|
8
|
|
|
8
|
0
|
20
|
my ( $self, %args ) = @_; |
52
|
8
|
|
|
|
|
136
|
return $self->syform->loaded_view_class->new({ |
53
|
|
|
|
|
|
|
results => $self, |
54
|
|
|
|
|
|
|
%args |
55
|
|
|
|
|
|
|
}); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub get_result { |
59
|
16
|
|
|
16
|
0
|
2796
|
my ( $self, $name ) = @_; |
60
|
16
|
|
|
|
|
108
|
return $self->results->{$name}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub has_result { |
64
|
21
|
|
|
21
|
0
|
1636
|
my ( $self, $name ) = @_; |
65
|
21
|
|
|
|
|
146
|
return exists($self->results->{$name}); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=pod |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 NAME |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
SyForm::Results - Results of the processing of SyForm::Values |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 VERSION |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
version 0.103 |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 AUTHOR |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Torsten Raudssus <torsten@raudss.us> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Torsten Raudssus. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
91
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |