Data::Serializer::Config::General - Creates bridge between Data::Serializer and Config::General


Data-Serializer documentation Contained in the Data-Serializer distribution.

Index


Code Index:

NAME

Top

Data::Serializer::Config::General - Creates bridge between Data::Serializer and Config::General

SYNOPSIS

Top

  use Data::Serializer::Config::General;

DESCRIPTION

Top

Module is used internally to Data::Serializer

METHODS

Top

serialize - Wrapper to normalize serializer method name
deserialize - Wrapper to normalize deserializer method name
options - Pass options through to underlying serializer

CAVEAT

Top

Base data structure to serialize must be a hash reference

AUTHOR

Top

Thomas Linden <tom@daemon.de>

COPYRIGHT

Top

SEE ALSO

Top

perl(1), Data::Serializer(3), Config::General(3)


Data-Serializer documentation Contained in the Data-Serializer distribution.

package Data::Serializer::Config::General;
BEGIN { @Data::Serializer::Config::General::ISA = qw(Data::Serializer) }
use warnings;
use strict;
use Config::General;
use vars qw($VERSION @ISA);

$VERSION = '0.02';
sub options {
  return (shift)->{options};
}

sub serialize {
  my $self = (shift);
  my $ref = (shift);
  return (new Config::General(%{$self->options()}, -ConfigHash => $ref))->save_string();
}

sub deserialize {
  my $self = (shift);
  my $ref = (shift);
  my %hash =  (new Config::General(%{$self->options()}, -String => $ref))->getall();
  return \%hash;
}

1;

__END__