File Coverage

blib/lib/WebService/PivotalTracker/ProjectIteration.pm
Criterion Covered Total %
statement 21 27 77.7
branch n/a
condition n/a
subroutine 7 9 77.7
pod 1 1 100.0
total 29 37 78.3


line stmt bran cond sub pod time code
1             package WebService::PivotalTracker::ProjectIteration;
2              
3 1     1   6 use strict;
  1         2  
  1         31  
4 1     1   4 use warnings;
  1         3  
  1         25  
5 1     1   5 use namespace::autoclean;
  1         2  
  1         9  
6              
7             our $VERSION = '0.12';
8              
9 1     1   83 use WebService::PivotalTracker::PropertyAttributes;
  1         3  
  1         46  
10 1     1   6 use WebService::PivotalTracker::Story;
  1         2  
  1         24  
11             use WebService::PivotalTracker::Types
12 1     1   4 qw( DateTimeObject NonEmptyStr PositiveInt PositiveNum );
  1         2  
  1         10  
13              
14 1     1   1112 use Moo;
  1         2  
  1         6  
15              
16             has( @{$_} ) for props_to_attributes(
17             number => PositiveInt,
18             length => PositiveInt,
19             team_strength => PositiveNum,
20             start => {
21             type => DateTimeObject,
22             inflator => '_inflate_iso8601_datetime',
23             },
24             finish => {
25             type => DateTimeObject,
26             inflator => '_inflate_iso8601_datetime',
27             },
28             kind => NonEmptyStr,
29             );
30              
31             with 'WebService::PivotalTracker::Entity';
32              
33             sub stories {
34 0     0 1   my $self = shift;
35              
36             return [
37             map {
38 0           WebService::PivotalTracker::Story->new(
39             raw_content => $_,
40             pt_api => $self->_pt_api,
41             )
42 0           } @{ $self->raw_content->{stories} }
  0            
43             ];
44             }
45              
46             ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
47             sub _self_uri {
48 0     0     my $self = shift;
49              
50 0           return $self->_client->build_uri(
51             sprintf(
52             '/projects/%s/iterations/%s',
53             $self->project_id,
54             $self->number,
55             )
56             );
57             }
58             ## use critic
59              
60             1;
61              
62             # ABSTRACT: A single iteration in a project
63              
64             __END__
65              
66             =pod
67              
68             =encoding UTF-8
69              
70             =head1 NAME
71              
72             WebService::PivotalTracker::ProjectIteration - A single iteration in a project
73              
74             =head1 VERSION
75              
76             version 0.12
77              
78             =head1 SYNOPSIS
79              
80             =head1 DESCRIPTION
81              
82             This class represents a single project iteration.
83              
84             =for Test::Synopsis my $pt;
85              
86             my $iterations = $pt->project_iterations(...)->[0];
87             say $_->name for $iteration->stories->@*;
88              
89             =head1 ATTRIBUTES
90              
91             This class provides the following attribute accessor methods. Each one
92             corresponds to a property defined by the L<PT REST API V5 iteration resource
93             docs|https://www.pivotaltracker.com/help/api/rest/v5#iteration_resource>.
94              
95             =head2 number
96              
97             =head2 length
98              
99             =head2 team_strength
100              
101             =head2 start
102              
103             This will be returned as a L<DateTime> object.
104              
105             =head2 finish
106              
107             This will be returned as a L<DateTime> object.
108              
109             =head2 kind
110              
111             =head2 raw_content
112              
113             The raw JSON used to create this object.
114              
115             =head1 METHODS
116              
117             This class provides the following methods:
118              
119             =head2 $iter->stories
120              
121             This method contains an array reference of
122             L<WebService::PivotalTracker::Story> object contained in the iteration.
123              
124             =head1 SUPPORT
125              
126             Bugs may be submitted through L<https://github.com/maxmind/WebService-PivotalTracker/issues>.
127              
128             =head1 AUTHOR
129              
130             Dave Rolsky <autarch@urth.org>
131              
132             =head1 COPYRIGHT AND LICENSE
133              
134             This software is Copyright (c) 2016 - 2020 by MaxMind, Inc.
135              
136             This is free software, licensed under:
137              
138             The Artistic License 2.0 (GPL Compatible)
139              
140             =cut