Mattermost/V4/API/Object/Role/BelongingToTeam.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_team
6.0
_build_team_id
2.0
BEGIN
1.0
CRAP 2.8
« Mattermost/V4/API/Object/Role/BelongingToChannel.pm ↑ Summary Mattermost/V4/API/Object/Reaction.pm »
1 package WebService::Mattermost::V4::API::Object::Role::BelongingToTeam;
2  
3 # ABSTRACT: Mark an object as belonging to a team.
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 team_id => (is => 'ro', isa => Maybe[Str], lazy => 1, builder => 1);
13 12 has team => (is => 'ro', isa => Maybe[InstanceOf[view 'Team']], lazy => 1, builder => 1);
14  
15 ################################################################################
16  
17 sub _build_team_id {
18 0 ▶ my $self = shift;
Subroutine _build_team_id: not called CC=1 SCAR=6.9
19  
20 0 return $self->raw_data->{team_id};
21 }
22  
23 sub _build_team {
24 0 ▶ my $self = shift;
Subroutine _build_team: not called CC=2 SCAR=17.9
25  
26 0 ▶ return unless $self->team_id;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->team_id 0 0 0
27 0 return $self->api->teams->get_by_id($self->team_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::BelongingToTeam - Mark an object as belonging to a team.
43  
44 =head1 VERSION
45  
46 version 0.28
47  
48 =head1 DESCRIPTION
49  
50 Link a view object to its creator.
51  
52 =head2 ATTRIBUTES
53  
54 =over 4
55  
56 =item C<team_id>
57  
58 The creator's string ID.
59  
60 =item C<team>
61  
62 Linked L<WebService::Mattermost::V4::API::Object::Team> 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/Role/BelongingToChannel.pm ↑ Summary Mattermost/V4/API/Object/Reaction.pm »