Transfigure/Schema.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 5 Podpod n/a totaltotal 0.0% 0 / 39 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Data::Transfigure::Schema 1.03;
2 use v5.26;
3 use warnings;
4  
5 use Object::Pad;
6  
7 class Data::Transfigure::Schema : does(Data::Transfigure::Node) {
8 use Scalar::Util qw(blessed);
9 use Data::Transfigure::Constants;
10  
11 field $schema : param;
12  
13 ADJUST {
14 say blessed($schema);
15 say ref($schema);
16 die("schema must be a JSON::Validator") unless (blessed($schema) && $schema->isa('JSON::Validator'));
17 }
18  
19 method applies_to (%params) {
20 my $node = $params{value};
21 my @errors = $schema->validate($node);
22 # warn @errors if @errors;
23 return $NO_MATCH if (@errors);
24 return $MATCH_EXACT_VALUE;
25 }
26 }