File Coverage

lib/JIRA/REST/Class/Issue/Changelog.pm
Criterion Covered Total %
statement 11 19 57.8
branch n/a
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 16 25 64.0


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