Added Test Suite
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Deserialize / YAML.pm
CommitLineData
256c894f 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
8package Catalyst::Action::Deserialize::YAML;
9
10use strict;
11use warnings;
12
13use base 'Catalyst::Action';
14use YAML::Syck;
256c894f 15
16sub execute {
17 my $self = shift;
18 my ( $controller, $c, $test ) = @_;
7ad87df9 19
20 my $body = $c->request->body;
21 if ($body) {
256c894f 22 my $rdata = LoadFile($c->request->body);
23 $c->request->data($rdata);
256c894f 24 } else {
7ad87df9 25 $c->log->debug('I would have deserialized, but there was nothing in the body!');
256c894f 26 }
27};
28
291;