TreeValidator/Util.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 50.0% 1 / 2 totaltotal 97.0% 33 / 34 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« TreeValidator/Types.pm ↑ Summary TreeValidator/Node.pm »
1 package Data::TreeValidator::Util;
2 {
3 6 $Data::TreeValidator::Util::VERSION = '0.04';
4 }
5 # ABSTRACT: Helpful utilities for working with tree validators
6 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 6 ▶use Sub::Exporter -setup => {
Subroutine BEGIN: called CC=1 SCAR=0.0
10 exports => [qw( fail_constraint )]
11 6 };
12  
13 {
14 package Data::TreeValidator::ConstraintError;
15 {
16 6 $Data::TreeValidator::ConstraintError::VERSION = '0.04';
17 }
18 6 ▶ use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 6 with 'Throwable';
20  
21 # XXX I think Throwable should provide this as a role - submit patch
22 use overload
23 6 ▶ q{""} => 'as_string',
Subroutine BEGIN: called CC=1 SCAR=0.0
24 6 fallback => 1;
25 6 has 'message' => ( is => 'ro' );
26 39 ▶ sub as_string { shift->message }
Subroutine as_string: called CC=1 SCAR=0.0
Pod undocumented
27 }
28  
29 6 ▶sub fail_constraint {
Subroutine fail_constraint: called CC=1 SCAR=0.0
Pod documented
30 22 Data::TreeValidator::ConstraintError->new(
31 message => shift )->throw;
32 }
33  
34 6 1;
35  
36  
37  
38 __END__
« TreeValidator/Types.pm ↑ Summary TreeValidator/Node.pm »