File Coverage

blib/lib/WWW/Giraffi/API/AppLog.pm
Criterion Covered Total %
statement 12 27 44.4
branch 0 2 0.0
condition n/a
subroutine 4 7 57.1
pod 3 3 100.0
total 19 39 48.7


line stmt bran cond sub pod time code
1             package WWW::Giraffi::API::AppLog;
2              
3 1     1   6 use strict;
  1         2  
  1         46  
4 1     1   6 use warnings;
  1         2  
  1         40  
5 1     1   6 use Time::Piece;
  1         2  
  1         7  
6              
7 1     1   71 use parent qw(WWW::Giraffi::API::Request);
  1         2  
  1         7  
8              
9             our $VERSION = '0.2_04';
10              
11             # this method has not been tested
12             sub all {
13              
14 0     0 1   my ( $self, $other_options ) = @_;
15 0           return $self->search(undef, $other_options);
16             }
17              
18             # this method has not been tested
19             sub search {
20             # no test
21 0     0 1   my ( $self, $conditions, $other_options ) = @_;
22 0           my $arrayref = $self->get( "applogs.json", $conditions, $other_options );
23 0 0         if ($self->use_time_piece) {
24 0           my $tmp_arrayref = [];
25 0           foreach my $ref(@{$arrayref}) {
  0            
26 0           $ref->{applog}->{time} = localtime($ref->{applog}->{time});
27 0           push @{$tmp_arrayref}, $ref;
  0            
28             }
29 0           $arrayref = $tmp_arrayref;
30             }
31 0           return $arrayref;
32             }
33              
34             # this method has not been tested
35             sub create {
36              
37 0     0 1   my ( $self, $conditions, $other_options ) = @_;
38 0           return $self->post( sprintf("%s/applogs.json", $self->applogs_endpoint), undef, { applog => $conditions }, $other_options );
39             }
40              
41             1;
42              
43             __END__