rename ActionRole::Serialize -> ActionRole::SerializeFormat
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Deserialize / YAML.pm
index 56ecb52..ec6063d 100644 (file)
@@ -1,32 +1,10 @@
-#
-# Catlyst::Action::Deserialize::YAML.pm
-# Created by: Adam Jacob, Marchex, <adam@marchex.com>
-# Created on: 10/12/2006 03:00:32 PM PDT
-#
-# $Id$
-
 package Catalyst::Action::Deserialize::YAML;
-
-use strict;
-use warnings;
-
-use base 'Catalyst::Action';
+use Moose;
+extends 'Catalyst::Action';
+with 'Catalyst::ActionRole::DeserializeFormat';
 use YAML::Syck;
-use Catalyst::Request::REST;
+use namespace::clean -except => 'meta';
 
-sub execute {
-    my $self = shift;
-    my ( $controller, $c, $test ) = @_;
-   
-    my $nreq = bless($c->request, 'Catalyst::Request::REST');
-    $c->request($nreq);
-    if ($c->request->method eq "POST" || $c->request->method eq "PUT") {
-        my $rdata = LoadFile($c->request->body);
-        $c->request->data($rdata);
-        $self->NEXT::execute( @_, );
-    } else {
-        $self->NEXT::execute( @_ );
-    }
-};
+sub deserialize { Load $_[1] }
 
 1;