sub full_path {
my ( $self, $path ) = @_;
$full_path = "$path/json";
- warn "## full_path: $full_path";
+ warn "## full_path: $full_path" if $debug;
return $full_path;
}
sub file {
my ( $self, $uid ) = @_;
my $file = "$full_path/$uid" . $self->extension;
- warn "## file -> $file";
+ warn "## file -> $file" if $debug;
return $file;
}
sub save_hash {
my ( $self, $file, $hash ) = @_;
- write_file( $file, to_json $hash );
+ write_file( $file, encode_json $hash );
}
sub load_hash {
my ( $self, $file ) = @_;
- from_json read_file( $file );
+ decode_json read_file( $file );
}
sub extension { '.js' };