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

filter: Statementstmt 85.7% 12 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 83.3% 15 / 18 CC 1 SCAR 2.2
CC
1
Cov
86%
_build_delete_at
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Mattermost/V4/API/Object/Role/UpdatedAt.pm ↑ Summary Mattermost/Util/Logger.pm »
1 package WebService::Mattermost::V4::API::Object::Role::Timestamps;
2  
3 # ABSTRACT: Adds common timestamp fields 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 12 with qw(
9 WebService::Mattermost::V4::API::Object::Role::CreatedAt
10 WebService::Mattermost::V4::API::Object::Role::UpdatedAt
11 );
12  
13 ################################################################################
14  
15 12 has [ qw(
16 delete_at
17 ) ] => (is => 'ro', isa => Maybe[Int], lazy => 1, builder => 1);
18  
19 12 has [ qw(
20 deleted_at
21 ) ] => (is => 'ro', isa => Maybe[InstanceOf['DateTime']], lazy => 1, builder => 1);
22  
23 ################################################################################
24  
25 sub _build_delete_at {
26 0 ▶ my $self = shift;
Subroutine _build_delete_at: not called CC=1 SCAR=6.9
27  
28 0 return $self->raw_data->{delete_at};
29 }
30  
31 sub _build_deleted_at {
32 1 ▶ my $self = shift;
Subroutine _build_deleted_at: called CC=1 SCAR=0.0
33  
34 1 return $self->_from_epoch($self->raw_data->{delete_at});
35 }
36  
37 ################################################################################
38  
39 12 1;
40  
41 __END__
42  
43 =pod
44  
45 =encoding UTF-8
46  
47 =head1 NAME
48  
49 WebService::Mattermost::V4::API::Object::Role::Timestamps - Adds common timestamp fields to an object.
50  
51 =head1 VERSION
52  
53 version 0.28
54  
55 =head1 DESCRIPTION
56  
57 Attach common timestamps to a v4::Object object.
58  
59 =head2 ATTRIBUTES
60  
61 =over 4
62  
63 =item C<delete_at>
64  
65 UNIX timestamp.
66  
67 =item C<deleted_at>
68  
69 C<DateTime> object.
70  
71 =back
72  
73 =head1 SEE ALSO
74  
75 =over 4
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/UpdatedAt.pm ↑ Summary Mattermost/Util/Logger.pm »