qw();
use Scalar::Util qw( blessed );
sub filename { return 'schema' }
sub suffix { return '.json' }
my $cache;
sub check {
my ( $self, $data ) = @_;
if ( not exists $cache->{ _CLASS($self
_CLASS($self) }->check($data);
}
sub decode_file {
my ( $self, $file ) = @_;
require JSON;
return JSON->new()->utf8(1)->relaxed(1)->decode( scalar $file->slurp() );
}
sub _make_rx {
my ($se
ta::Rx::Tools::ShareDirValidator';
sub filename { 'schema' } # default value.
sub suffix {'.json'} # default value.
1;
...
Later:
use Foo;
Foo->check({ some => [ 'data', 'structure'