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   1691 use parent qw( JIRA::REST::Class::Abstract );
  4         8  
  4         16  
3 4     4   205 use strict;
  4         4  
  4         53  
4 4     4   11 use warnings;
  4         5  
  4         71  
5 4     4   89 use 5.010;
  4         9  
6              
7             our $VERSION = '0.10';
8             our $SOURCE = 'CPAN';
9             ## $SOURCE = 'GitHub'; # COMMENT
10             # the line above will be commented out by Dist::Zilla
11              
12 4     4   11 use Readonly 2.04;
  4         40  
  4         582  
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 Alexey Melezhik Atlassian GreenHopper JRC ScriptRunner TODO
97             aggregateprogress aggregatetimeestimate aggregatetimeoriginalestimate
98             assigneeType avatar avatarUrls completeDate displayName duedate
99             emailAddress endDate fieldtype fixVersions fromString genericized iconUrl
100             isAssigneeTypeValid issueTypes issuekeys issuelinks issuetype jira jql
101             lastViewed maxResults originalEstimate originalEstimateSeconds parentkey
102             projectId rapidViewId remainingEstimate remainingEstimateSeconds
103             resolutiondate sprintlist startDate subtaskIssueTypes timeSpent
104             timeSpentSeconds timeestimate timeoriginalestimate timespent timetracking
105             toString updateAuthor worklog workratio
106              
107             =head1 NAME
108              
109             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.
110              
111             =head1 VERSION
112              
113             version 0.10
114              
115             =head1 READ-ONLY ACCESSORS
116              
117             =head2 B<author>
118              
119             This method returns the author of the JIRA issue's work item as a
120             L<JIRA::REST::Class::User|JIRA::REST::Class::User> object.
121              
122             =head2 B<comment>
123              
124             This method returns the comment of the JIRA issue's work item as a string.
125              
126             =head2 B<created>
127              
128             This method returns the creation time of the JIRA issue's work item as a
129             L<DateTime|DateTime> object.
130              
131             =head2 B<id>
132              
133             This method returns the ID of the JIRA issue's work item as a string.
134              
135             =head2 B<self>
136              
137             This method returns the JIRA REST API URL of the work item as a string.
138              
139             =head2 B<started>
140              
141             This method returns the start time of the JIRA issue's work item as a
142             L<DateTime|DateTime> object.
143              
144             =head2 B<timeSpent>
145              
146             This method returns the time spent on the JIRA issue's work item as a string.
147              
148             =head2 B<timeSpentSeconds>
149              
150             This method returns the time spent on the JIRA issue's work item as a number
151             of seconds.
152              
153             =head2 B<updateAuthor>
154              
155             This method returns the update author of the JIRA issue's work item as a
156             L<JIRA::REST::Class::User|JIRA::REST::Class::User> object.
157              
158             =head2 B<updated>
159              
160             This method returns the update time of the JIRA issue's work item as a
161             L<DateTime|DateTime> object.
162              
163             =head1 RELATED CLASSES
164              
165             =over 2
166              
167             =item * L<JIRA::REST::Class|JIRA::REST::Class>
168              
169             =item * L<JIRA::REST::Class::Abstract|JIRA::REST::Class::Abstract>
170              
171             =item * L<JIRA::REST::Class::User|JIRA::REST::Class::User>
172              
173             =back
174              
175             =head1 AUTHOR
176              
177             Packy Anderson <packy@cpan.org>
178              
179             =head1 COPYRIGHT AND LICENSE
180              
181             This software is Copyright (c) 2017 by Packy Anderson.
182              
183             This is free software, licensed under:
184              
185             The Artistic License 2.0 (GPL Compatible)
186              
187             =cut