b9728300989b5f3da22decbba5482671c7b2b61d
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Deserialize / YAML.pm
1 #
2 # Catlyst::Action::Deserialize::YAML.pm
3 # Created by: Adam Jacob, Marchex, <adam@marchex.com>
4 # Created on: 10/12/2006 03:00:32 PM PDT
5 #
6 # $Id$
7
8 package Catalyst::Action::Deserialize::YAML;
9
10 use strict;
11 use warnings;
12
13 use base 'Catalyst::Action';
14 use YAML::Syck;
15
16 sub execute {
17     my $self = shift;
18     my ( $controller, $c, $test ) = @_;
19
20     my $body = $c->request->body;
21     if ($body) {
22         my $rdata = LoadFile( $c->request->body );
23         $c->request->data($rdata);
24     } else {
25         $c->log->debug(
26             'I would have deserialized, but there was nothing in the body!');
27     }
28 }
29
30 1;