File Coverage

blib/lib/WWW/Ohloh/API/Enlistments.pm
Criterion Covered Total %
statement 28 31 90.3
branch n/a
condition n/a
subroutine 11 13 84.6
pod 0 4 0.0
total 39 48 81.2


line stmt bran cond sub pod time code
1             package WWW::Ohloh::API::Enlistments;
2             our $AUTHORITY = 'cpan:YANICK';
3              
4 29     29   259496 use strict;
  29         65  
  29         1170  
5 29     29   144 use warnings;
  29         58  
  29         1672  
6              
7 29     29   1155 use Object::InsideOut qw/ WWW::Ohloh::API::Collection /;
  29         71691  
  29         193  
8              
9 29     29   5572 use Carp;
  29         59  
  29         3139  
10 29     29   1018 use XML::LibXML;
  29         53292  
  29         387  
11 29     29   7007 use Readonly;
  29         5879  
  29         1799  
12 29     29   943 use List::MoreUtils qw/ any /;
  29         20341  
  29         262  
13 29     29   40355 use WWW::Ohloh::API::Enlistment;
  29         124  
  29         213  
14              
15             our $VERSION = '1.0_1';
16              
17             my @ALLOWED_SORTING;
18             Readonly @ALLOWED_SORTING => qw/ module_name type url /;
19              
20             my @project_id_of : Field : Arg(project_id) : Set(_set_project_id) :
21             Get(project_id);
22              
23 1     1 0 3 sub element { return 'WWW::Ohloh::API::Enlistment' }
24 1     1 0 6 sub element_name { return 'enlistment' }
25              
26             sub query_path {
27 1     1 0 2 my $self = shift;
28 1         9 return "projects/$project_id_of[$$self]/enlistments.xml";
29             }
30              
31             #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32              
33             sub is_allowed_sort {
34 0     0 0   my $s = shift;
35 0     0     return any { $s eq $_ } @ALLOWED_SORTING;
  0            
36             }
37              
38             #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39              
40             'end of WWW::Ohloh::API::Enlistments';
41              
42             __END__