File Coverage

blib/lib/WWW/FCM/HTTP/Response/ResultSet.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition 2 2 100.0
subroutine 5 5 100.0
pod 0 2 0.0
total 24 26 92.3


line stmt bran cond sub pod time code
1             package WWW::FCM::HTTP::Response::ResultSet;
2              
3 3     3   13 use strict;
  3         5  
  3         60  
4 3     3   12 use warnings;
  3         3  
  3         57  
5 3     3   950 use WWW::FCM::HTTP::Response::Result;
  3         14  
  3         275  
6              
7             sub new {
8 4     4 0 45 my ($class, $results, $sent_reg_ids) = @_;
9              
10 4         22 bless {
11             results => $results,
12             sent_reg_ids => $sent_reg_ids,
13             }, $class;
14             }
15              
16             sub next {
17 10     10 0 4984 my $self = shift;
18 10   100     15 my $result = shift @{ $self->{results} } || return;
19 6         10 my $sent_reg_id = shift @{ $self->{sent_reg_ids} };
  6         13  
20 6         35 $result->{_sent_reg_id} = $sent_reg_id;
21 6         66 WWW::FCM::HTTP::Response::Result->new($result);
22             }
23              
24             1;