remove hardcoded version strings
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Serialize / YAML.pm
CommitLineData
256c894f 1package Catalyst::Action::Serialize::YAML;
2
930013e6 3use Moose;
4use namespace::autoclean;
256c894f 5
930013e6 6extends 'Catalyst::Action';
256c894f 7use YAML::Syck;
8
cc188065 9# VERSION
f465980c 10
256c894f 11sub execute {
12 my $self = shift;
e601adda 13 my ( $controller, $c ) = @_;
256c894f 14
faf5c20b 15 my $stash_key = (
07682cbc 16 $controller->{'serialize'} ?
17 $controller->{'serialize'}->{'stash_key'} :
18 $controller->{'stash_key'}
faf5c20b 19 ) || 'rest';
7f36b63e 20 my $output = $self->serialize($c->stash->{$stash_key});
e601adda 21 $c->response->output( $output );
256c894f 22 return 1;
eccb2137 23}
256c894f 24
485b5160 25sub serialize {
26 my $self = shift;
27 my $data = shift;
28 Dump($data);
29}
30
24748286 31__PACKAGE__->meta->make_immutable;
32
256c894f 331;