File Coverage

lib/JIRA/REST/Class/Query.pm
Criterion Covered Total %
statement 11 17 64.7
branch n/a
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 17 25 68.0


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