blib/lib/Lemonldap/NG/Common/Conf/AccessLib.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 37 CC 3 SCAR 18.4
CC
3
Cov
0%
confAcc
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 6.3
1 package Lemonldap::NG::Common::Conf::AccessLib;
2  
3 use strict;
4 use utf8;
5 use Mouse;
6  
7 use Lemonldap::NG::Common::Conf;
8  
9 has _confAcc => ( is => 'rw', isa => 'Lemonldap::NG::Common::Conf' );
10 has configStorage => ( is => 'rw', isa => 'HashRef', default => sub { {} } );
11 has currentConf => ( is => 'rw', required => 1, default => sub { {} } );
12 has protection => ( is => 'rw', isa => 'Str', default => 'manager' );
13  
14 our $VERSION = '2.0.11';
15  
16 ## @method Lemonldap::NG::Common::Conf confAcc()
17 # Configuration access object
18 #
19 # Return _confAcc property if exists or create it.
20 #
21 #@return Lemonldap::NG::Common::Conf object
22 sub confAcc {
23 my $self = shift;
24 return $self->_confAcc if ( $self->_confAcc );
25  
26 # TODO: pass args and remove this
27 my $d = `pwd`;
28 chomp $d;
29 my $tmp;
30 unless ( $tmp = Lemonldap::NG::Common::Conf->new( $self->configStorage ) ) {
31 die "Unable to build Lemonldap::NG::Common::Conf "
32 . $Lemonldap::NG::Common::Conf::msg;
33 }
34 return $self->_confAcc($tmp);
35 }
36  
37 1;