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