File Coverage

blib/lib/Statistics/R/IO/RDS.pm
Criterion Covered Total %
statement 3 5 60.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 5 7 71.4


line stmt bran cond sub pod time code
1             package Statistics::R::IO::RDS;
2             # ABSTRACT: Supply object methods for RDS files
3             $Statistics::R::IO::RDS::VERSION = '1.0';
4 1     1   15815 use 5.010;
  1         2  
5              
6 1     1   734 use Moose;
  0            
  0            
7              
8             with 'Statistics::R::IO::Base';
9              
10             use Statistics::R::IO::REXPFactory;
11             use Carp;
12              
13             use namespace::clean;
14              
15              
16             sub read {
17             my $self = shift;
18            
19             my $data = $self->_read_and_uncompress;
20            
21             my ($value, $state) = @{Statistics::R::IO::REXPFactory::unserialize($data)};
22             croak 'Could not parse RDS file' unless $state;
23             croak 'Unread data remaining in the RDS file' unless $state->eof;
24             $value
25             }
26              
27              
28             __PACKAGE__->meta->make_immutable;
29              
30             1;
31              
32             __END__