| 1 | package Statistics::R::IO::RDS; | ||||||||||
| 2 | # ABSTRACT: Supply object methods for RDS files | ||||||||||
| 3 | 1 | $Statistics::R::IO::RDS::VERSION = '1.0002'; | |||||||||
| 4 | 1 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Class::Tiny::Antlers; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | extends 'Statistics::R::IO::Base'; | |||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Statistics::R::IO::REXPFactory; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | 477 | ▶ | sub read { | ||||||||
|
Subroutine
read: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||
| 17 | 477 | my $self = shift; | |||||||||
| 18 | |||||||||||
| 19 | 477 | my $data = $self->_read_and_uncompress; | |||||||||
| 20 | |||||||||||
| 21 | 424 | my ($value, $state) = @{Statistics::R::IO::REXPFactory::unserialize($data)}; | |||||||||
| 22 | 424 | ▶ | croak 'Could not parse RDS file' unless $state; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 424 | ▶ | croak 'Unread data remaining in the RDS file' unless $state->eof; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 424 | $value | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | |||||||||||
| 28 | 1 | 1; | |||||||||
| 29 | |||||||||||
| 30 | __END__ | ||||||||||