From d817af5411ef2b7592e4b4f3da466e2e05fe365e Mon Sep 17 00:00:00 2001 From: franck cuny Date: Wed, 2 Jun 2010 11:36:46 +0200 Subject: parser to (de)serialize content --- lib/MooseX/Net/API/Parser/JSON.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/MooseX/Net/API/Parser/JSON.pm (limited to 'lib/MooseX/Net/API/Parser/JSON.pm') diff --git a/lib/MooseX/Net/API/Parser/JSON.pm b/lib/MooseX/Net/API/Parser/JSON.pm new file mode 100644 index 0000000..4711a8a --- /dev/null +++ b/lib/MooseX/Net/API/Parser/JSON.pm @@ -0,0 +1,17 @@ +package MooseX::Net::API::Parser::JSON; + +use JSON; +use Moose; +extends 'MooseX::Net::API::Parser'; + +sub encode { + my ($self, $content) = @_; + return JSON::encode_json($content); +} + +sub decode { + my ($self, $content) = @_; + return JSON::decode_json($content); +} + +1; -- cgit v1.2.3