X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Action-Serialize-Data-Serializer.git;a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FData%2FSerializer.pm;fp=lib%2FCatalyst%2FAction%2FSerialize%2FData%2FSerializer.pm;h=bf7cbd6c9751ed13dc542c3e99449394217f8d25;hp=545d43a30ece265fcfc1fe66a33df440dd4c7a19;hb=79025f72c27ba313b3c701cee238f84166f32f9e;hpb=f10c7e1c7eb3b4cb10401dbb86ca8db3dc38ced2 diff --git a/lib/Catalyst/Action/Serialize/Data/Serializer.pm b/lib/Catalyst/Action/Serialize/Data/Serializer.pm index 545d43a..bf7cbd6 100644 --- a/lib/Catalyst/Action/Serialize/Data/Serializer.pm +++ b/lib/Catalyst/Action/Serialize/Data/Serializer.pm @@ -16,7 +16,7 @@ sub execute { my $stash_key = ( $controller->{'serialize'} ? $controller->{'serialize'}->{'stash_key'} : - $controller->{'stash_key'} + $controller->{'stash_key'} ) || 'rest'; my $sp = $serializer; $sp =~ s/::/\//g; @@ -37,3 +37,83 @@ sub execute { __PACKAGE__->meta->make_immutable; 1; + +__END__ + +=pod + +=head1 NAME + +Catalyst::Action::Serialize::Data::Serializer - Serialize with Data::Serializer + +=head1 SYNOPSIS + + package MyApp::Controller::Foo; + + use Moose; + use namespace::autoclean; + + BEGIN { extends 'Catalyst::Controller' } + + __PACKAGE__->config( + 'default' => 'text/x-yaml', + 'stash_key' => 'rest', + 'map' => { + 'text/x-yaml' => 'YAML', + 'application/json' => 'JSON', + 'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ], + }, + ); + +=head1 DESCRIPTION + +This module implements a serializer for use with C and others. It +was factored out of L because it is unlikely to be +widely used and tends to break tests, be insecure, and is genreally weird. Use +at your own risk. + +=head1 AUTHOR + +Adam Jacob Eadam@stalecoffee.orgE, with lots of help from mst and jrockway + +Marchex, Inc. paid me while I developed this module. (L) + +=head1 CONTRIBUTORS + +Tomas Doran (t0m) Ebobtfish@bobtfish.netE + +John Goulah + +Christopher Laco + +Daisuke Maki Edaisuke@endeworks.jpE + +Hans Dieter Pearcey + +Brian Phillips Ebphillips@cpan.orgE + +Dave Rolsky Eautarch@urth.orgE + +Luke Saunders + +Arthur Axel "fREW" Schmidt Efrioux@gmail.comE + +J. Shirley Ejshirley@gmail.comE + +Gavin Henry Eghenry@surevoip.co.ukE + +Gerv http://www.gerv.net/ + +Colin Newell + +Wallace Reis Ewreis@cpan.orgE + +=head1 COPYRIGHT + +Copyright (c) 2006-2013 the above named AUTHOR and CONTRIBUTORS + +=head1 LICENSE + +You may distribute this code under the same terms as Perl itself. + +=cut