File Coverage

lib/JIRA/REST/Class/Issue/Worklog/Item.pm
Criterion Covered Total %
statement 14 21 66.6
branch n/a
condition n/a
subroutine 5 6 83.3
pod 1 1 100.0
total 20 28 71.4


line stmt bran cond sub pod time code
1             package JIRA::REST::Class::Issue::Worklog::Item;
2 4     4   1962 use parent qw( JIRA::REST::Class::Abstract );
  4         10  
  4         20  
3 4     4   247 use strict;
  4         12  
  4         62  
4 4     4   16 use warnings;
  4         8  
  4         73  
5 4     4   50 use 5.010;
  4         13  
6              
7             our $VERSION = '0.11';
8             our $SOURCE = 'CPAN';
9             ## $SOURCE = 'GitHub'; # COMMENT
10             # the line above will be commented out by Dist::Zilla
11              
12 4     4   22 use Readonly 2.04;
  4         46  
  4         626  
13              
14             # ABSTRACT: A helper class for L<JIRA::REST::Class|JIRA::REST::Class> that represents an individual worklog item for a JIRA issue as an object.
15              
16             Readonly my @USERS => qw( author updateAuthor );
17             Readonly my @DATES => qw( created updated );
18             Readonly my @ACCESSORS => qw( comment id self timeSpent timeSpentSeconds );
19              
20             __PACKAGE__->mk_ro_accessors( @USERS, @DATES );
21             __PACKAGE__->mk_data_ro_accessors( @ACCESSORS );
22              
23             sub init {
24 0     0 1   my $self = shift;
25 0           $self->SUPER::init( @_ );
26              
27             # make user objects
28 0           foreach my $field ( @USERS ) {
29 0           $self->populate_scalar_data( $field, 'user', $field );
30             }
31              
32             # make date objects
33 0           foreach my $field ( @DATES ) {
34 0           $self->populate_date_data( $field, $field );
35             }
36              
37 0           return;
38             }
39              
40             1;
41              
42             #pod =accessor B<author>
43             #pod
44             #pod This method returns the author of the JIRA issue's work item as a
45             #pod L<JIRA::REST::Class::User|JIRA::REST::Class::User> object.
46             #pod
47             #pod =accessor B<comment>
48             #pod
49             #pod This method returns the comment of the JIRA issue's work item as a string.
50             #pod
51             #pod =accessor B<created>
52             #pod
53             #pod This method returns the creation time of the JIRA issue's work item as a
54             #pod L<DateTime|DateTime> object.
55             #pod
56             #pod =accessor B<id>
57             #pod
58             #pod This method returns the ID of the JIRA issue's work item as a string.
59             #pod
60             #pod =accessor B<self>
61             #pod
62             #pod This method returns the JIRA REST API URL of the work item as a string.
63             #pod
64             #pod =accessor B<started>
65             #pod
66             #pod This method returns the start time of the JIRA issue's work item as a
67             #pod L<DateTime|DateTime> object.
68             #pod
69             #pod =accessor B<timeSpent>
70             #pod
71             #pod This method returns the time spent on the JIRA issue's work item as a string.
72             #pod
73             #pod =accessor B<timeSpentSeconds>
74             #pod
75             #pod This method returns the time spent on the JIRA issue's work item as a number
76             #pod of seconds.
77             #pod
78             #pod =accessor B<updateAuthor>
79             #pod
80             #pod This method returns the update author of the JIRA issue's work item as a
81             #pod L<JIRA::REST::Class::User|JIRA::REST::Class::User> object.
82             #pod
83             #pod =accessor B<updated>
84             #pod
85             #pod This method returns the update time of the JIRA issue's work item as a
86             #pod L<DateTime|DateTime> object.
87             #pod
88             #pod =cut
89              
90             __END__
91              
92             =pod
93              
94             =encoding UTF-8
95              
96             =for :stopwords Packy Anderson Alexandr Alexey Ciornii Melezhik Atlassian GreenHopper JRC
97             ScriptRunner TODO aggregateprogress aggregatetimeestimate
98             aggregatetimeoriginalestimate assigneeType avatar avatarUrls completeDate
99             displayName duedate emailAddress endDate fieldtype fixVersions fromString
100             genericized iconUrl isAssigneeTypeValid issueTypes issuekeys issuelinks
101             issuetype jira jql lastViewed maxResults originalEstimate
102             originalEstimateSeconds parentkey projectId rapidViewId remainingEstimate
103             remainingEstimateSeconds resolutiondate sprintlist startDate
104             subtaskIssueTypes timeSpent timeSpentSeconds timeestimate
105             timeoriginalestimate timespent timetracking toString updateAuthor worklog
106             workratio
107              
108             =head1 NAME
109              
110             JIRA::REST::Class::Issue::Worklog::Item - A helper class for L<JIRA::REST::Class|JIRA::REST::Class> that represents an individual worklog item for a JIRA issue as an object.
111              
112             =head1 VERSION
113              
114             version 0.11
115              
116             =head1 READ-ONLY ACCESSORS
117              
118             =head2 B<author>
119              
120             This method returns the author of the JIRA issue's work item as a
121             L<JIRA::REST::Class::User|JIRA::REST::Class::User> object.
122              
123             =head2 B<comment>
124              
125             This method returns the comment of the JIRA issue's work item as a string.
126              
127             =head2 B<created>
128              
129             This method returns the creation time of the JIRA issue's work item as a
130             L<DateTime|DateTime> object.
131              
132             =head2 B<id>
133              
134             This method returns the ID of the JIRA issue's work item as a string.
135              
136             =head2 B<self>
137              
138             This method returns the JIRA REST API URL of the work item as a string.
139              
140             =head2 B<started>
141              
142             This method returns the start time of the JIRA issue's work item as a
143             L<DateTime|DateTime> object.
144              
145             =head2 B<timeSpent>
146              
147             This method returns the time spent on the JIRA issue's work item as a string.
148              
149             =head2 B<timeSpentSeconds>
150              
151             This method returns the time spent on the JIRA issue's work item as a number
152             of seconds.
153              
154             =head2 B<updateAuthor>
155              
156             This method returns the update author of the JIRA issue's work item as a
157             L<JIRA::REST::Class::User|JIRA::REST::Class::User> object.
158              
159             =head2 B<updated>
160              
161             This method returns the update time of the JIRA issue's work item as a
162             L<DateTime|DateTime> object.
163              
164             =head1 RELATED CLASSES
165              
166             =over 2
167              
168             =item * L<JIRA::REST::Class|JIRA::REST::Class>
169              
170             =item * L<JIRA::REST::Class::Abstract|JIRA::REST::Class::Abstract>
171              
172             =item * L<JIRA::REST::Class::User|JIRA::REST::Class::User>
173              
174             =back
175              
176             =head1 AUTHOR
177              
178             Packy Anderson <packy@cpan.org>
179              
180             =head1 COPYRIGHT AND LICENSE
181              
182             This software is Copyright (c) 2017 by Packy Anderson.
183              
184             This is free software, licensed under:
185              
186             The Artistic License 2.0 (GPL Compatible)
187              
188             =cut