File Coverage

blib/lib/OpenInteract2/Exception/Parameter.pm
Criterion Covered Total %
statement 6 16 37.5
branch 0 2 0.0
condition n/a
subroutine 2 4 50.0
pod 2 2 100.0
total 10 24 41.6


line stmt bran cond sub pod time code
1             package OpenInteract2::Exception::Parameter;
2              
3             # $Id: Parameter.pm,v 1.7 2005/03/17 14:58:02 sjn Exp $
4              
5 86     86   530 use strict;
  86         3766  
  86         3875  
6 86     86   461 use base qw( OpenInteract2::Exception Class::Accessor::Fast );
  86         191  
  86         34406  
7              
8             $OpenInteract2::Exception::Parameter::VERSION = sprintf("%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/);
9              
10             my @FIELDS = qw( parameter_fail );
11             OpenInteract2::Exception::Parameter->mk_accessors( @FIELDS );
12 0     0 1   sub Fields { return @FIELDS }
13              
14             sub full_message {
15 0     0 1   my ( $self ) = @_;
16 0           my $failures = $self->parameter_fail;
17 0           my @errors = ();
18 0           foreach my $field ( sort keys %{ $failures } ) {
  0            
19 0           my $field_msg = ( ref $failures->{ $field } eq 'ARRAY' )
20 0 0         ? join( '; ', @{ $failures->{ $field } } )
21             : $failures->{ $field };
22 0           push @errors, "$field: $field_msg";
23             }
24 0           return "One or more parameters were not valid: " . join( ' ;; ', @errors );
25             }
26              
27             1;
28              
29             __END__