line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::TraitFor::Request::DecodedParams; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
34739
|
use Moose::Role; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use namespace::autoclean; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
requires qw/_build_params_decoder _do_decode_params/; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has '_params_decoder' => ( |
11
|
|
|
|
|
|
|
init_arg => undef, is => 'ro', |
12
|
|
|
|
|
|
|
lazy => 1, builder => '_build_params_decoder', |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has decoded_params => ( |
16
|
|
|
|
|
|
|
init_arg => undef, isa => 'HashRef', |
17
|
|
|
|
|
|
|
is => 'ro', lazy => 1, builder => '_build_decoded_params', |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _build_decoded_params { |
21
|
|
|
|
|
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
return $self->_do_decode_params($self->params); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub decoded_parameters { return shift->decoded_params } |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub dparams { return shift->decoded_params } |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has decoded_query_params => ( |
30
|
|
|
|
|
|
|
init_arg => undef, isa => 'HashRef', |
31
|
|
|
|
|
|
|
is => 'ro', lazy => 1, builder => '_build_decoded_query_params', |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _build_decoded_query_params { |
35
|
|
|
|
|
|
|
my $self = shift; |
36
|
|
|
|
|
|
|
return $self->_do_decode_params($self->query_params); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub decoded_query_parameters { return shift->decoded_query_params } |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub dquery_params { return shift->decoded_query_params } |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has decoded_body_params => ( |
44
|
|
|
|
|
|
|
init_arg => undef, isa => 'HashRef', |
45
|
|
|
|
|
|
|
is => 'ro', lazy => 1, builder => '_build_decoded_body_params', |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _build_decoded_body_params { |
49
|
|
|
|
|
|
|
my $self = shift; |
50
|
|
|
|
|
|
|
return $self->_do_decode_params($self->body_params); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub decoded_body_parameters { return shift->decoded_body_params } |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub dbody_params { return shift->decoded_body_params } |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 NAME |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Catalyst::TraitFor::Request::DecodedParams - A request trait for params decoding |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SYNOPSIS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
package MyApp; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
use Moose; |
70
|
|
|
|
|
|
|
use namespace::autoclean; |
71
|
|
|
|
|
|
|
use CatalystX::RoleApplicator; |
72
|
|
|
|
|
|
|
use Catalyst; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
extends 'Catalyst'; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__PACKAGE__->apply_request_class_roles(qw/ |
77
|
|
|
|
|
|
|
Catalyst::TraitFor::Request::DecodedParams::JSON |
78
|
|
|
|
|
|
|
/); |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 METHODS |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=over |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item decoded_query_parameters |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
decoded_query_params, dquery_params |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item decoded_body_parameters |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
decoded_body_params, dbody_params |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item decoded_parameters |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
decoded_params, dparams |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=back |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 AUTHOR |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Wallace Reis C<< <wreis at cpan.org> >> |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 LICENSE |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
This library is free software and may be distributed under the same terms as |
107
|
|
|
|
|
|
|
perl itself. |
108
|
|
|
|
|
|
|
=cut |