line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bot::ChatBots::Role::Sender; |
2
|
2
|
|
|
2
|
|
76617
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
48
|
|
3
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
68
|
|
4
|
|
|
|
|
|
|
{ our $VERSION = '0.014'; } |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
7
|
use Moo::Role; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
7
|
|
|
|
|
|
|
with 'Bot::ChatBots::Role::Processor'; |
8
|
|
|
|
|
|
|
requires 'send_message'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has recipient => ( |
11
|
|
|
|
|
|
|
is => 'rw', |
12
|
|
|
|
|
|
|
lazy => 1, |
13
|
|
|
|
|
|
|
predicate => 1, |
14
|
|
|
|
|
|
|
clearer => 1, |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub process { |
18
|
2
|
|
|
2
|
1
|
7
|
my ($self, $record) = @_; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$record->{sent_message} = $self->send_message($record->{send_message}) |
21
|
2
|
100
|
66
|
|
|
19
|
if (ref($record) eq 'HASH') && exists($record->{send_message}); |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
19
|
return $record; # pass-through anyway |
24
|
|
|
|
|
|
|
} ## end sub process |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |