line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
869
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
189
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTML::FormFu::Deflator::Callback; |
4
|
|
|
|
|
|
|
$HTML::FormFu::Deflator::Callback::VERSION = '2.07'; |
5
|
|
|
|
|
|
|
# ABSTRACT: Callback deflator |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
18
|
use Moose; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
22
|
|
8
|
3
|
|
|
3
|
|
21307
|
use MooseX::Attribute::Chained; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
371
|
|
9
|
|
|
|
|
|
|
extends 'HTML::FormFu::Deflator'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has callback => ( is => 'rw', traits => ['Chained'] ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub deflator { |
14
|
3
|
|
|
3
|
0
|
15
|
my ( $self, $value ) = @_; |
15
|
|
|
|
|
|
|
|
16
|
3
|
|
50
|
0
|
|
90
|
my $callback = $self->callback || sub {shift}; |
|
0
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
## no critic (ProhibitNoStrict); |
19
|
3
|
|
|
3
|
|
24
|
no strict 'refs'; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
260
|
|
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
21
|
return $callback->($value); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=encoding UTF-8 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
HTML::FormFu::Deflator::Callback - Callback deflator |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 VERSION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
version 2.07 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
$field->deflator('Callback')->callback( \&my_callback ); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
--- |
47
|
|
|
|
|
|
|
elements: |
48
|
|
|
|
|
|
|
- type: Text |
49
|
|
|
|
|
|
|
name: foo |
50
|
|
|
|
|
|
|
deflators: |
51
|
|
|
|
|
|
|
- type: Callback |
52
|
|
|
|
|
|
|
callback: "main::my_deflator" |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 DESCRIPTION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Callback deflator. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 METHODS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 callback |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Arguments: \&code-reference |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Arguments: "subroutine-name" |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SEE ALSO |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Is a sub-class of, and inherits methods from L<HTML::FormFu::Deflator> |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
L<HTML::FormFu::FormFu> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHOR |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Carl Franks C<cfranks@cpan.org> |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 LICENSE |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as Perl itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 AUTHOR |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Carl Franks <cpan@fireartist.com> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This software is copyright (c) 2018 by Carl Franks. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
90
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |