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   3230 use strict;
  2         3  
  2         45  
4 2     2   8 use warnings;
  2         4  
  2         37  
5              
6 2     2   6 use Carp;
  2         2  
  2         83  
7              
8 2     2   7 use parent qw/Enbld::Target::AttributeExtension::Word/;
  2         2  
  2         6  
9              
10             sub initialize {
11 53     53 0 117 my ( $self, $param ) = @_;
12              
13 53 100       140 if ( ! defined $param ) {
14             $self->{callback} = sub {
15 1     1   6 return $self->{attributes}->ArchiveName;
16 1         7 };
17              
18 1         2 return $self;
19             }
20              
21 52 100       100 if ( $param ) {
22 51         141 $self->SUPER::initialize( $param );
23 51         83 return $self;
24             }
25              
26 1         314 require Enbld::Exception;
27 1         4 croak( Enbld::Exception->new( "Attribute 'DistName' isn't defined" ) );
28             }
29              
30             1;