File Coverage

blib/lib/Enbld/Target/Attribute/URL.pm
Criterion Covered Total %
statement 23 23 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 33 34 97.0


line stmt bran cond sub pod time code
1             package Enbld::Target::Attribute::URL;
2              
3 2     2   3471 use strict;
  2         3  
  2         57  
4 2     2   8 use warnings;
  2         1  
  2         49  
5              
6 2     2   8 use Carp;
  2         2  
  2         116  
7              
8 2     2   14 use parent qw/Enbld::Target::AttributeExtension::URL/;
  2         3  
  2         10  
9              
10             sub initialize {
11 53     53 0 94 my ( $self, $param ) = @_;
12              
13 53 100       128 if ( ! defined $param ) {
14             $self->{callback} = sub {
15 30     30   47 my $attributes = shift;
16              
17 30         92 return $attributes->DownloadSite . $attributes->Filename;
18 47         317 };
19              
20 47         105 return $self;
21             }
22              
23 6 100       12 if ( $param ) {
24 5         15 $self->SUPER::initialize( $param );
25 5         6 return $self;
26             }
27              
28 1         361 require Enbld::Exception;
29 1         4 croak( Enbld::Exception->new( "Attribute 'URL' isn't defined" ) );
30             }
31              
32             1;