Mattermost/V4/API/Object/Role/BelongingToChannel.pm

filter: Statementstmt 70.5% 12 / 17 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 62.5% 15 / 24 CC 2 SCAR 10.4
CC
2
Cov
63%
_build_channel
6.0
_build_channel_id
2.0
BEGIN
1.0
CRAP 2.8
« Mattermost/V4/API/Object/Team.pm ↑ Summary Mattermost/V4/API/Object/Role/BelongingToTeam.pm »
1 package WebService::Mattermost::V4::API::Object::Role::BelongingToChannel;
2  
3 # ABSTRACT: Mark an object as belonging to a channel.
4  
5 12 ▶use Moo::Role;
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 ################################################################################
11  
12 12 has channel_id => (is => 'ro', isa => Maybe[Str], lazy => 1, builder => 1);
13 12 has channel => (is => 'ro', isa => Maybe[InstanceOf[view 'Channel']], lazy => 1, builder => 1);
14  
15 ################################################################################
16  
17 sub _build_channel_id {
18 0 ▶ my $self = shift;
Subroutine _build_channel_id: not called CC=1 SCAR=6.9
19  
20 0 return $self->raw_data->{channel_id};
21 }
22  
23 sub _build_channel {
24 0 ▶ my $self = shift;
Subroutine _build_channel: not called CC=2 SCAR=17.9
25  
26 0 ▶ return unless $self->channel_id;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->channel_id 0 0 0
27 0 return $self->api->channel->get($self->channel_id)->item;
28 }
29  
30 ################################################################################
31  
32 12 1;
33  
34 __END__
35  
36 =pod
37  
38 =encoding UTF-8
39  
40 =head1 NAME
41  
42 WebService::Mattermost::V4::API::Object::Role::BelongingToChannel - Mark an object as belonging to a channel.
43  
44 =head1 VERSION
45  
46 version 0.28
47  
48 =head1 DESCRIPTION
49  
50 Link a view object to its channel.
51  
52 =head2 ATTRIBUTES
53  
54 =over 4
55  
56 =item C<channel_id>
57  
58 The channel's ID.
59  
60 =item C<channel>
61  
62 Linked L<WebService::Mattermost::V4::API::Object::Channel> object.
63  
64 =back
65  
66 =head1 AUTHOR
67  
68 Mike Jones <mike@netsplit.org.uk>
69  
70 =head1 COPYRIGHT AND LICENSE
71  
72 This software is Copyright (c) 2020 by Mike Jones.
73  
74 This is free software, licensed under:
75  
76 The MIT (X11) License
77  
78 =cut
« Mattermost/V4/API/Object/Team.pm ↑ Summary Mattermost/V4/API/Object/Role/BelongingToTeam.pm »