line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
1884
|
use 5.008008; |
|
4
|
|
|
|
|
14
|
|
2
|
4
|
|
|
4
|
|
22
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
88
|
|
3
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
251
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Ask::Callback; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.015'; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
1720
|
use Moo; |
|
4
|
|
|
|
|
8568
|
|
|
4
|
|
|
|
|
25
|
|
11
|
4
|
|
|
4
|
|
4726
|
use namespace::autoclean; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
31
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Ask::API'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has input_callback => ( is => 'ro', required => 1 ); |
16
|
|
|
|
|
|
|
has output_callback => ( is => 'ro', required => 1 ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub is_usable { |
19
|
3
|
|
|
3
|
0
|
13
|
my ( $self ) = @_; |
20
|
3
|
50
|
|
|
|
64
|
ref $self->output_callback eq 'CODE' |
21
|
|
|
|
|
|
|
and ref $self->input_callback eq 'CODE'; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub quality { |
25
|
9
|
|
|
9
|
0
|
170
|
return 0; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub entry { |
29
|
16
|
|
|
16
|
0
|
60
|
my ( $self ) = @_; |
30
|
16
|
|
|
|
|
94
|
return $self->input_callback->(); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub info { |
34
|
7
|
|
|
7
|
0
|
1368
|
my ( $self, %o ) = @_; |
35
|
7
|
|
|
|
|
35
|
return $self->output_callback->( $o{text} ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |