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   20 use strict;
  3         7  
  3         98  
4 3     3   16 use warnings;
  3         7  
  3         85  
5 3     3   1201 use WWW::FCM::HTTP::Response::Result;
  3         19  
  3         387  
6              
7             sub new {
8 4     4 0 89 my ($class, $results, $sent_reg_ids) = @_;
9              
10 4         41 bless {
11             results => $results,
12             sent_reg_ids => $sent_reg_ids,
13             }, $class;
14             }
15              
16             sub next {
17 10     10 0 6046 my $self = shift;
18 10   100     21 my $result = shift @{ $self->{results} } || return;
19 6         13 my $sent_reg_id = shift @{ $self->{sent_reg_ids} };
  6         15  
20 6         17 $result->{_sent_reg_id} = $sent_reg_id;
21 6         92 WWW::FCM::HTTP::Response::Result->new($result);
22             }
23              
24             1;