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