File Coverage

blib/lib/Statistics/R/IO/RDS.pm
Criterion Covered Total %
statement 21 21 100.0
branch 2 4 50.0
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 30 32 93.7


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.0001';
4 1     1   21910 use 5.010;
  1         3  
5              
6 1     1   555 use Class::Tiny::Antlers;
  1         4959  
  1         5  
7              
8             extends 'Statistics::R::IO::Base';
9              
10 1     1   591 use Statistics::R::IO::REXPFactory;
  1         2  
  1         44  
11 1     1   5 use Carp;
  1         2  
  1         48  
12              
13 1     1   4 use namespace::clean;
  1         2  
  1         3  
14              
15              
16             sub read {
17 477     477 1 4479 my $self = shift;
18            
19 477         1117 my $data = $self->_read_and_uncompress;
20            
21 424         500 my ($value, $state) = @{Statistics::R::IO::REXPFactory::unserialize($data)};
  424         1138  
22 424 50       836 croak 'Could not parse RDS file' unless $state;
23 424 50       750 croak 'Unread data remaining in the RDS file' unless $state->eof;
24 424         2301 $value
25             }
26              
27              
28             1;
29              
30             __END__