File Coverage

blib/lib/Mastodon/Entity/Notification.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             package Mastodon::Entity::Notification;
2              
3 3     3   18582 use strict;
  3         9  
  3         99  
4 3     3   15 use warnings;
  3         7  
  3         133  
5              
6             our $VERSION = '0.017';
7              
8 3     3   21 use Moo;
  3         9  
  3         23  
9             with 'Mastodon::Role::Entity';
10              
11 3     3   1082 use Types::Standard qw( Int Enum );
  3         8  
  3         23  
12 3     3   2971 use Mastodon::Types qw( Status DateTime Account );
  3         7  
  3         20  
13              
14             has account => ( is => 'ro', isa => Account, );
15             has created_at => ( is => 'ro', isa => DateTime, );
16             has id => ( is => 'ro', isa => Int, );
17             has status => ( is => 'ro', isa => Status, required => 1, coerce => 1, );
18             has type => ( is => 'ro', isa => Enum[qw(
19             mention reblog favourite follow
20             )], );
21              
22             1;
23              
24             =encoding utf8
25              
26             =head1 NAME
27              
28             Mastodon::Entity::Notification - A Mastodon notification
29              
30             =head1 DESCRIPTION
31              
32             This object should not be manually created. It is intended to be generated
33             from the data received from a Mastodon server using the coercions in
34             L<Mastodon::Types>.
35              
36             For current information, see the
37             L<Mastodon API documentation|https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#notification>
38              
39             =head1 ATTRIBUTES
40              
41             =over 4
42              
43             =item B<id>
44              
45             The notification ID.
46              
47             =item B<type>
48              
49             One of: "mention", "reblog", "favourite", "follow".
50              
51             =item B<created_at>
52              
53             The time the notification was created.
54              
55             =item B<account>
56              
57             The Account sending the notification to the user as a
58             L<Mastodon::Entity::Account> object.
59              
60             =item B<status>
61              
62             The Status associated with the notification, if applicable. As a
63             L<Mastodon::Entity::Status> object.
64              
65             =back
66              
67             =head1 AUTHOR
68              
69             =over 4
70              
71             =item *
72              
73             José Joaquín Atria <jjatria@cpan.org>
74              
75             =back
76              
77             =head1 COPYRIGHT AND LICENSE
78              
79             This software is copyright (c) 2017 by José Joaquín Atria.
80              
81             This is free software; you can redistribute it and/or modify it under
82             the same terms as the Perl 5 programming language system itself.
83              
84             =cut