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

filter: Statementstmt 69.2% 9 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod n/a totaltotal 64.7% 11 / 17 CC 1 SCAR 4.1
CC
1
Cov
69%
_build_expires_at
2.0
_build_expires
2.0
BEGIN
1.0
CRAP 1.5
« Mattermost/V4/API/Resource/Email.pm ↑ Summary Mattermost/V4/API/Object/Role/LastActivityAt.pm »
1 package WebService::Mattermost::V4::API::Object::Role::ExpiresAt;
2  
3 # ABSTRACT: Adds an "expires_at" field to an object.
4  
5 12 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Types::Standard qw(InstanceOf Int Maybe);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 ################################################################################
9  
10 12 has expires_at => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1);
11 12 has expires => (is => 'ro', isa => Maybe[InstanceOf['DateTime']], lazy => 1, builder => 1);
12  
13 ################################################################################
14  
15 sub _build_expires_at {
16 0 ▶ my $self = shift;
Subroutine _build_expires_at: not called CC=1 SCAR=6.9
17  
18 0 return $self->raw_data->{expires_at};
19 }
20  
21 sub _build_expires {
22 0 ▶ my $self = shift;
Subroutine _build_expires: not called CC=1 SCAR=6.9
23  
24 0 return $self->_from_epoch($self->expires_at);
25 }
26  
27 ################################################################################
28  
29 12 1;
30  
31 __END__
32  
33 =pod
34  
35 =encoding UTF-8
36  
37 =head1 NAME
38  
39 WebService::Mattermost::V4::API::Object::Role::ExpiresAt - Adds an "expires_at" field to an object.
40  
41 =head1 VERSION
42  
43 version 0.28
44  
45 =head1 DESCRIPTION
46  
47 Attach common timestamps to a v4::Object object.
48  
49 =head2 ATTRIBUTES
50  
51 =over 4
52  
53 =item C<expires_at>
54  
55 UNIX timestamp.
56  
57 =item C<expires>
58  
59 C<DateTime> object.
60  
61 =back
62  
63 =head1 NAME
64  
65 WebService::Mattermost::V4::API::Object::Role::ExpiresAt
66  
67 =head1 AUTHOR
68  
69 Mike Jones L<email:mike@netsplit.org.uk>
70  
71 =head1 AUTHOR
72  
73 Mike Jones <mike@netsplit.org.uk>
74  
75 =head1 COPYRIGHT AND LICENSE
76  
77 This software is Copyright (c) 2020 by Mike Jones.
78  
79 This is free software, licensed under:
80  
81 The MIT (X11) License
82  
83 =cut
« Mattermost/V4/API/Resource/Email.pm ↑ Summary Mattermost/V4/API/Object/Role/LastActivityAt.pm »