Add new serializer for JSON::XS
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Serialize / JSON.pm
index 561b49b..a681bcf 100644 (file)
@@ -24,7 +24,7 @@ sub execute {
         ) || 'rest';
     my $output;
     eval {
-        $output = encode_json( $c->stash->{$stash_key} );
+        $output = $self->encode( $c->stash->{$stash_key} );
     };
     if ($@) {
         return $@;
@@ -33,4 +33,9 @@ sub execute {
     return 1;
 }
 
+sub encode {
+    my $self = shift;
+    encode_json( @_ );
+}
+
 1;