line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
44152
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
41
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
121
|
|
3
|
|
|
|
|
|
|
package Data::InputMonster::Util::Catalyst; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Data::InputMonster::Util::Catalyst::VERSION = '0.005'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
# ABSTRACT: InputMonster sources for common Catalyst sources |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
8
|
use Carp (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
11
|
1
|
|
|
1
|
|
1262
|
use Sub::Exporter::Util qw(curry_method); |
|
1
|
|
|
|
|
16419
|
|
|
1
|
|
|
|
|
10
|
|
12
|
1
|
|
|
|
|
5
|
use Sub::Exporter -setup => { |
13
|
|
|
|
|
|
|
exports => { |
14
|
|
|
|
|
|
|
form_param => curry_method, |
15
|
|
|
|
|
|
|
body_param => curry_method, |
16
|
|
|
|
|
|
|
query_param => curry_method, |
17
|
|
|
|
|
|
|
session_entry => curry_method, |
18
|
|
|
|
|
|
|
} |
19
|
1
|
|
|
1
|
|
237
|
}; |
|
1
|
|
|
|
|
2
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub form_param { |
23
|
1
|
|
|
1
|
1
|
8
|
my ($self, $field_name) = @_; |
24
|
|
|
|
|
|
|
sub { |
25
|
1
|
50
|
|
1
|
|
27
|
my $field_name = defined $field_name ? $field_name : $_[2]{field_name}; |
26
|
1
|
|
|
|
|
4
|
return $_[1]->req->params->{ $field_name }; |
27
|
|
|
|
|
|
|
} |
28
|
1
|
|
|
|
|
11
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub body_param { |
32
|
1
|
|
|
1
|
1
|
6
|
my ($self, $field_name) = @_; |
33
|
|
|
|
|
|
|
sub { |
34
|
1
|
50
|
|
1
|
|
30
|
my $field_name = defined $field_name ? $field_name : $_[2]{field_name}; |
35
|
1
|
|
|
|
|
4
|
return $_[1]->req->body_params->{ $field_name }; |
36
|
|
|
|
|
|
|
} |
37
|
1
|
|
|
|
|
23
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub query_param { |
41
|
2
|
|
|
2
|
1
|
30
|
my ($self, $field_name) = @_; |
42
|
|
|
|
|
|
|
sub { |
43
|
2
|
100
|
|
2
|
|
149
|
my $field_name = defined $field_name ? $field_name : $_[2]{field_name}; |
44
|
2
|
|
|
|
|
9
|
return $_[1]->req->query_params->{ $field_name }; |
45
|
|
|
|
|
|
|
} |
46
|
2
|
|
|
|
|
21
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub session_entry { |
50
|
3
|
|
|
3
|
1
|
17
|
my ($self, $locator) = @_; |
51
|
|
|
|
|
|
|
|
52
|
3
|
|
|
|
|
1104
|
require Data::InputMonster::Util; |
53
|
3
|
|
|
|
|
1158
|
my $digger = Data::InputMonster::Util->dig($locator); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
return sub { |
56
|
3
|
|
|
3
|
|
96
|
my ($monster, $input, $arg) = @_; |
57
|
3
|
|
|
|
|
10
|
$monster->$digger($input->session, $arg); |
58
|
3
|
|
|
|
|
58
|
}; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
q{$C IS FOR CATALSYT, THAT'S GOOD ENOUGH FOR ME}; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |