1 package CWMP::Store::JSON;
7 use base qw/CWMP::Store::HASH/;
14 CWMP::Store::YAML - use YAML as storage
21 my ( $self, $path ) = @_;
22 $full_path = "$path/json";
23 warn "## full_path: $full_path" if $debug;
28 my ( $self, $uid ) = @_;
29 my $file = "$full_path/$uid" . $self->extension;
30 warn "## file -> $file" if $debug;
35 my ( $self, $file, $hash ) = @_;
36 write_file( $file, to_json $hash );
40 my ( $self, $file ) = @_;
41 from_json read_file( $file );
44 sub extension { '.js' };