Math-SimpleHisto-XS

 view release on metacpan or  search on metacpan

lib/Math/SimpleHisto/XS/Named.pm  view on Meta::CPAN


sub new_from_dump {
  my $class = shift;
  my $type = lc(shift);
  my $data = shift;

  my $struct = $Math::SimpleHisto::XS::JSON->decode($data);
  $class = delete $struct->{class};
  my $hclass = delete $struct->{histclass};
  $struct->{hist} = $hclass->new_from_dump($type, delete $struct->{hist});
  return bless($struct => $class);
}

# Can't simply be delegated, eventhough the implementation is the same :(
sub STORABLE_freeze {
  my $self = shift;
  my $cloning = shift;
  my $serialized = $self->dump('simple');
  return $serialized;
}

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.304 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )