File Coverage

blib/lib/Net/Async/Slack/Event/Message.pm
Criterion Covered Total %
statement 10 22 45.4
branch n/a
condition 0 9 0.0
subroutine 4 13 30.7
pod 0 10 0.0
total 14 54 25.9


line stmt bran cond sub pod time code
1             package Net::Async::Slack::Event::Message;
2              
3 4     4   247543 use strict;
  4         11  
  4         186  
4 4     4   20 use warnings;
  4         9  
  4         396  
5              
6             our $VERSION = '0.015'; # VERSION
7              
8 4     4   656 use Net::Async::Slack::EventType;
  4         9  
  4         29  
9              
10             =head1 DESCRIPTION
11              
12             {
13             channel => "D5GSPCF62",
14             source_team => "T4PQME0Q2",
15             team => "T4PQME0Q2",
16             text => "test",
17             ts => "1497119268.495648",
18             type => "message",
19             user => "U4P3UKGBA"
20             }
21              
22             =cut
23              
24 0     0 0 0 sub slack { shift->{slack} }
25              
26             sub channel {
27 0     0 0 0 my ($self) = @_;
28 0   0     0 $self->{channel} //= $self->slack->channel_info($self->channel_id)
29             }
30              
31             sub source_team {
32 0     0 0 0 my ($self) = @_;
33 0   0     0 $self->{source_team} //= $self->slack->team_info($self->source_team_id)
34             }
35              
36             sub team {
37 0     0 0 0 my ($self) = @_;
38 0   0     0 $self->{team} //= $self->slack->team_info($self->team_id)
39             }
40              
41 0     0 0 0 sub channel_id { shift->{channel_id} }
42              
43 0     0 0 0 sub source_team_id { shift->{source_team_id} }
44              
45 0     0 0 0 sub team_id { shift->{team_id} }
46              
47 0     0 0 0 sub text { shift->{text} }
48              
49 0     0 0 0 sub ts { shift->{ts} }
50              
51 8     8 0 35 sub type { 'message' }
52              
53             1;
54