File Coverage

blib/lib/WWW/Giraffi/API/Trend.pm
Criterion Covered Total %
statement 12 35 34.2
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 18 47 38.3


line stmt bran cond sub pod time code
1             package WWW::Giraffi::API::Trend;
2              
3 1     1   5 use strict;
  1         2  
  1         28  
4 1     1   4 use warnings;
  1         1  
  1         20  
5 1     1   5 use Time::Piece;
  1         1  
  1         7  
6              
7 1     1   66 use parent qw(WWW::Giraffi::API::Request);
  1         1  
  1         4  
8              
9             our $VERSION = '0.2_04';
10              
11             sub search_average {
12              
13 0     0 1   my ( $self, $conditions, $other_options ) = @_;
14 0           my $arrayref = $self->get( "trends/average.json", $conditions, $other_options );
15 0 0         if ($self->use_time_piece) {
16 0           my $tmp_arrayref = [];
17 0           foreach my $ref(@{$arrayref}) {
  0            
18 0           $ref->{checked_at} = localtime($ref->{checked_at});
19 0           push @{$tmp_arrayref}, $ref;
  0            
20             }
21 0           $arrayref = $tmp_arrayref;
22             }
23 0           return $arrayref;
24             }
25              
26             sub search_failure {
27              
28 0     0 1   my ( $self, $conditions, $other_options ) = @_;
29 0           my $arrayref = $self->get( "trends/failure.json", $conditions, $other_options );
30 0 0         if ($self->use_time_piece) {
31 0           my $tmp_arrayref = [];
32 0           foreach my $ref(@{$arrayref}) {
  0            
33 0           $ref->{failed_start_at} = localtime($ref->{failed_start_at});
34 0           $ref->{failed_end_at} = localtime($ref->{failed_end_at});
35 0           push @{$tmp_arrayref}, $ref;
  0            
36             }
37 0           $arrayref = $tmp_arrayref;
38             }
39 0           return $arrayref;
40             }
41              
42              
43             1;
44              
45             __END__