From e97449eaa8bd3a408763057f9ca2253d93e2a3d0 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Fri, 16 Jul 2010 16:10:41 +0200 Subject: rename from mx::net::api to net::http::api --- lib/Net/HTTP/API/Parser/JSON.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/Net/HTTP/API/Parser/JSON.pm (limited to 'lib/Net/HTTP/API/Parser/JSON.pm') diff --git a/lib/Net/HTTP/API/Parser/JSON.pm b/lib/Net/HTTP/API/Parser/JSON.pm new file mode 100644 index 0000000..be8b30e --- /dev/null +++ b/lib/Net/HTTP/API/Parser/JSON.pm @@ -0,0 +1,23 @@ +package Net::HTTP::API::Parser::JSON; + +# ABSTRACT: Parse JSON + +use JSON; +use Moose; +extends 'Net::HTTP::API::Parser'; + +sub encode { + my ($self, $content) = @_; + return JSON::encode_json($content); +} + +sub decode { + my ($self, $content) = @_; + return JSON::decode_json($content); +} + +1; + +=head1 SYNOPSIS + +=head1 DESCRIPTION -- cgit v1.2.3