| 1 | package JIRA::REST::Class::Issue::Worklog; | ||
| 2 | use parent qw( JIRA::REST::Class::Abstract ); | ||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use 5.010; | ||
| 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 | # ABSTRACT: A helper class for L<JIRA::REST::Class|JIRA::REST::Class> that represents the worklog of a JIRA issue as an object. | ||
| 13 | |||
| 14 | __PACKAGE__->mk_contextual_ro_accessors( qw/ items / ); | ||
| 15 | |||
| 16 | sub init { | ||
| 17 | my $self = shift; | ||
| 18 | $self->SUPER::init( @_ ); | ||
| 19 | |||
| 20 | $self->{data} = $self->issue->get( '/worklog' ); | ||
| 21 | my $items = $self->{items} = []; | ||
| 22 | |||
| 23 | foreach my $item ( @{ $self->data->{worklogs} } ) { | ||
| 24 | push @$items, | ||
| 25 | $self->issue->make_object( 'workitem', { data => $item } ); | ||
| 26 | } | ||
| 27 | |||
| 28 | return; | ||
| 29 | } | ||
| 30 | |||
| 31 | #pod =method B<items> | ||
| 32 | #pod | ||
| 33 | #pod Returns a list of individual work items, as | ||
| 34 | #pod L<JIRA::REST::Class::Issue::Worklog::Item|JIRA::REST::Class::Issue::Worklog::Item> | ||
| 35 | #pod objects. | ||
| 36 | #pod | ||
| 37 | #pod =for stopwords worklog | ||
| 38 | #pod | ||
| 39 | #pod =cut | ||
| 40 | |||
| 41 | 1; | ||
| 42 | |||
| 43 | __END__ | ||
| 44 | |||
| 45 | =pod | ||
| 46 | |||
| 47 | =encoding UTF-8 | ||
| 48 | |||
| 49 | =for :stopwords Packy Anderson Alexey Melezhik worklog | ||
| 50 | |||
| 51 | =head1 NAME | ||
| 52 | |||
| 53 | JIRA::REST::Class::Issue::Worklog - A helper class for L<JIRA::REST::Class|JIRA::REST::Class> that represents the worklog of a JIRA issue as an object. | ||
| 54 | |||
| 55 | =head1 VERSION | ||
| 56 | |||
| 57 | version 0.10 | ||
| 58 | |||
| 59 | =head1 METHODS | ||
| 60 | |||
| 61 | =head2 B<items> | ||
| 62 | |||
| 63 | Returns a list of individual work items, as | ||
| 64 | L<JIRA::REST::Class::Issue::Worklog::Item|JIRA::REST::Class::Issue::Worklog::Item> | ||
| 65 | objects. | ||
| 66 | |||
| 67 | =head1 RELATED CLASSES | ||
| 68 | |||
| 69 | =over 2 | ||
| 70 | |||
| 71 | =item * L<JIRA::REST::Class|JIRA::REST::Class> | ||
| 72 | |||
| 73 | =item * L<JIRA::REST::Class::Abstract|JIRA::REST::Class::Abstract> | ||
| 74 | |||
| 75 | =item * L<JIRA::REST::Class::Issue::Worklog::Item|JIRA::REST::Class::Issue::Worklog::Item> | ||
| 76 | |||
| 77 | =back | ||
| 78 | |||
| 79 | =head1 AUTHOR | ||
| 80 | |||
| 81 | Packy Anderson <packy@cpan.org> | ||
| 82 | |||
| 83 | =head1 COPYRIGHT AND LICENSE | ||
| 84 | |||
| 85 | This software is Copyright (c) 2017 by Packy Anderson. | ||
| 86 | |||
| 87 | This is free software, licensed under: | ||
| 88 | |||
| 89 | The Artistic License 2.0 (GPL Compatible) | ||
| 90 | |||
| 91 | =cut |