r48@latte: adam | 2006-12-03 11:32:40 -0800
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Serialize / Data / Serializer.pm
CommitLineData
7ad87df9 1#
2# Catalyst::Action::Serialize::Data::Serializer
3# Created by: Adam Jacob, Marchex, <adam@marchex.com>
4#
5# $Id$
6
7package Catalyst::Action::Serialize::Data::Serializer;
8
9use strict;
10use warnings;
11
12use base 'Catalyst::Action';
13use Data::Serializer;
14
15sub execute {
16 my $self = shift;
17 my ( $controller, $c, $serializer ) = @_;
18
19 my $stash_key = $controller->serialize->{'stash_key'} || 'rest';
eccb2137 20 my $dso = Data::Serializer->new( serializer => $serializer );
7ad87df9 21 $c->response->output( $dso->raw_serialize( $c->stash->{$stash_key} ) );
22 return 1;
eccb2137 23}
7ad87df9 24
251;