Mattermost/V4/API/Object/Reaction.pm

filter: Statementstmt 77.7% 14 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 68.0% 17 / 25 CC 2 SCAR 10.4
CC
2
Cov
70%
_build_emoji
6.0
_build_emoji_name
2.0
BEGIN
1.0
CRAP 2.8
« Mattermost/V4/API/Object/Role/BelongingToTeam.pm ↑ Summary Mattermost/V4/API/Request.pm »
1 package WebService::Mattermost::V4::API::Object::Reaction;
2  
3 # ABSTRACT: A reaction item.
4  
5 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Types::Standard qw(InstanceOf Maybe Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 12 ▶use WebService::Mattermost::Helper::Alias 'view';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 12 extends 'WebService::Mattermost::V4::API::Object';
11 12 with qw(
12 WebService::Mattermost::V4::API::Object::Role::BelongingToPost
13 WebService::Mattermost::V4::API::Object::Role::BelongingToUser
14 WebService::Mattermost::V4::API::Object::Role::CreatedAt
15 );
16  
17 ################################################################################
18  
19 12 has emoji_name => (is => 'ro', isa => Maybe[Str], lazy => 1, builder => 1);
20 12 has emoji => (is => 'ro', isa => Maybe[InstanceOf[view 'Emoji']], lazy => 1, builder => 1);
21  
22 ################################################################################
23  
24 0 ▶sub _build_emoji_name { shift->raw_data->{emoji_name} }
Subroutine _build_emoji_name: not called CC=1 SCAR=6.9
25  
26 sub _build_emoji {
27 0 ▶ my $self = shift;
Subroutine _build_emoji: not called CC=2 SCAR=17.9
28  
29 0 ▶ return unless $self->emoji_name;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->emoji_name 0 0 0
30 0 return $self->api->emoji->get_by_name($self->emoji_name)->item;
31 }
32  
33 ################################################################################
34  
35 12 1;
36  
37 __END__
38  
39 =pod
40  
41 =encoding UTF-8
42  
43 =head1 NAME
44  
45 WebService::Mattermost::V4::API::Object::Reaction - A reaction item.
46  
47 =head1 VERSION
48  
49 version 0.28
50  
51 =head1 DESCRIPTION
52  
53 Details a Mattermost reaction object.
54  
55 =head2 ATTRIBUTES
56  
57 =over 4
58  
59 =item C<emoji_name>
60  
61 The name of the emoji attached to the post.
62  
63 =item C<emoji>
64  
65 Related L<WebService::Mattermost::V4::API::Object::Emoji> object.
66  
67 =back
68  
69 =head1 SEE ALSO
70  
71 =over 4
72  
73 =item L<WebService::Mattermost::V4::API::Object::Role::BelongingToPost>
74  
75 =item L<WebService::Mattermost::V4::API::Object::Role::BelongingToUser>
76  
77 =item L<WebService::Mattermost::V4::API::Object::Role::CreatedAt>
78  
79 =back
80  
81 =head1 AUTHOR
82  
83 Mike Jones <mike@netsplit.org.uk>
84  
85 =head1 COPYRIGHT AND LICENSE
86  
87 This software is Copyright (c) 2020 by Mike Jones.
88  
89 This is free software, licensed under:
90  
91 The MIT (X11) License
92  
93 =cut
« Mattermost/V4/API/Object/Role/BelongingToTeam.pm ↑ Summary Mattermost/V4/API/Request.pm »