Exception/Validator/FailedField.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 45 CC 4 SCAR 18.3
CC
4
Cov
0%
new
12.0
as_string
6.0
import
2.0
CRAP 6.2
1 package Exception::Validator::FailedField;
2 $Exception::Validator::FailedField::VERSION = '0.012';
3 use base qw(Exception::Validator);
4  
5 use Scalar::Util qw(blessed);
6  
7 sub import {
8 FF->export_to_level(1);
9 }
10  
11 sub new {
12 my ($this, $text, %data) = @_;
13  
14 my $class = ref($this) || $this;
15  
16 $text = '' if !defined $text;
17  
18 my $self = {
19 %data,
20 (
21 blessed($text) && $text->isa('Exception')
22 ? (text => $text->{'text'}, parent => $text)
23 : (text => $text)
24 ),
25 };
26  
27 return bless $self, $class;
28 }
29  
30 sub as_string {
31 my ($self) = @_;
32  
33 return ref($self) . ": $self->{'text'}\n" . ($self->{'parent'} ? "\n$self->{'parent'}\n" : '');
34 }
35  
36 package FF;
37 $FF::VERSION = '0.012';
38 use base qw(Exception::Validator::FailedField Exporter);
39  
40 1;