File Coverage

blib/lib/Enbld/Target/Attribute/DownloadSite.pm
Criterion Covered Total %
statement 24 24 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 34 36 94.4


line stmt bran cond sub pod time code
1             package Enbld::Target::Attribute::DownloadSite;
2              
3 4     4   8851 use strict;
  4         7  
  4         111  
4 4     4   15 use warnings;
  4         5  
  4         91  
5              
6 4     4   13 use Carp;
  4         5  
  4         198  
7              
8 4     4   1088 use parent qw/Enbld::Target::AttributeExtension::URL/;
  4         641  
  4         16  
9              
10             sub initialize {
11 57     57 0 119 my ( $self, $param ) = @_;
12              
13 57 100       142 if ( $param ) {
14 55         158 $self->SUPER::initialize( $param );
15 55         91 return $self;
16             }
17              
18 2         308 require Enbld::Exception;
19 2         6 croak( Enbld::Exception->new( "Attribute 'DownloadSite' isn't defined" ));
20             }
21              
22             sub validate {
23 71     71 0 81 my ( $self, $string ) = @_;
24              
25 71         237 $self->SUPER::validate( $string );
26              
27 67 100       268 return $string if ( $string =~ /\/$/ );
28              
29 1         2 my $err = "Attribute 'DownloadSite' does not end with slash character";
30 1         6 require Enbld::Exception;
31 1         9 croak( Enbld::Exception->new( $err, $string ));
32             }
33              
34             1;