File Coverage

blib/lib/Enbld/Target/Attribute/DistName.pm
Criterion Covered Total %
statement 22 22 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 32 33 96.9


line stmt bran cond sub pod time code
1             package Enbld::Target::Attribute::DistName;
2              
3 2     2   4309 use strict;
  2         3  
  2         60  
4 2     2   7 use warnings;
  2         2  
  2         40  
5              
6 2     2   10 use Carp;
  2         2  
  2         97  
7              
8 2     2   7 use parent qw/Enbld::Target::AttributeExtension::Word/;
  2         4  
  2         8  
9              
10             sub initialize {
11 53     53 0 108 my ( $self, $param ) = @_;
12              
13 53 100       154 if ( ! defined $param ) {
14             $self->{callback} = sub {
15 1     1   5 return $self->{attributes}->ArchiveName;
16 1         9 };
17              
18 1         2 return $self;
19             }
20              
21 52 100       117 if ( $param ) {
22 51         220 $self->SUPER::initialize( $param );
23 51         94 return $self;
24             }
25              
26 1         3 require Enbld::Exception;
27 1         4 croak( Enbld::Exception->new( "Attribute 'DistName' isn't defined" ) );
28             }
29              
30             1;