2 # Catlyst::Action::Serialize::YAML.pm
3 # Created by: Adam Jacob, Marchex, <adam@marchex.com>
4 # Created on: 10/12/2006 03:00:32 PM PDT
8 package Catalyst::Action::Serialize::YAML;
13 use base 'Catalyst::Action';
18 my ( $controller, $c, $test ) = @_;
20 my $stash_key = $controller->serialize->{'stash_key'} || 'rest';
22 if (! $c->response->content_type ) {
23 $c->response->content_type($c->req->content_type);
25 return 1 if $c->req->method eq 'HEAD';
26 return 1 if length( $c->response->body );
27 return 1 if scalar @{ $c->error };
28 return 1 if $c->response->status =~ /^(?:204|3\d\d)$/;
30 $c->response->output( Dump( $c->stash->{$stash_key} ) );