JSArrayParser: Add JSJSONArrayParser as new (and preferred) method to parse JSON
[videosite.git] / videosite / JSJSONArrayParser.pm
1 #
2 # A helper class for parsing textual JS hashes into perl 
3 # hashes
4 #
5 # This parser is based on the perl JSON module
6 #
7
8 package videosite::JSJSONArrayParser;
9
10 use videosite::JSArrayParser;
11 use JSON;
12 @ISA = qw(videosite::JSArrayParser);
13
14 use strict;
15
16 sub new {
17     my $class = shift;
18     my $self = $class->SUPER::new();
19
20     return bless($self, $class);
21 }
22
23 sub parse {
24     my $self = shift;
25     my $s = shift;
26
27     return decode_json($s);
28 }
29
30 1;