File Coverage

blib/lib/WebService/Mattermost/V4/API/Object/Log.pm
Criterion Covered Total %
statement 6 11 54.5
branch n/a
condition n/a
subroutine 2 6 33.3
pod n/a
total 8 17 47.0


line stmt bran cond sub pod time code
1             package WebService::Mattermost::V4::API::Object::Log;
2:

3: # ABSTRACT: A log item. 4:
5: use Moo;
6: use Types::Standard qw(Maybe InstanceOf Int Str);
7:
8: extends 'WebService::Mattermost::V4::API::Object';
9: with 'WebService::Mattermost::V4::API::Object::Role::Level';
10:
11: ################################################################################
12:
13: has [ qw(caller msg ts) ] => (is => 'ro', isa => Maybe[Str], lazy => 1, builder => 1);
14: has timestamp => (is => 'ro', isa => Maybe[InstanceOf['DateTime']], lazy => 1, builder => 1);
15:
16: ################################################################################
17:
18: sub _build_caller { shift->raw_data->{caller} }
19: sub _build_msg { shift->raw_data->{msg} }
20: sub _build_ts { shift->raw_data->{ts} }
21:
22: sub _build_timestamp {
23: my $self = shift;
24:
25: return $self->_from_epoch($self->ts);
26: }
27:
28: ################################################################################
29:
30: 1;
31:
32: __END__
33:
34: =pod
35:
36: =encoding UTF-8
37:
38: =head1 NAME
39:
40: WebService::Mattermost::V4::API::Object::Log - A log item.
41:
42: =head1 VERSION
43:
44: version 0.28
45:
46: =head1 DESCRIPTION
47:
48: Details a Mattermost Log object.
49:
50: =head2 ATTRIBUTES
51:
52: =over 4
53:
54: =item C<caller>
55:
56: =item C<msg>
57:
58: =item C<ts>
59:
60: UNIX timestamp.
61:
62: =item C<timestamp>
63:
64: DateTime.
65:
66: =back
67:
68: =head1 AUTHOR
69:
70: Mike Jones <mike@netsplit.org.uk>
71:
72: =head1 COPYRIGHT AND LICENSE
73:
74: This software is Copyright (c) 2020 by Mike Jones.
75:
76: This is free software, licensed under:
77:
78: The MIT (X11) License
79:
80: =cut
81: