File Coverage

blib/lib/App/Config/Chronicle/Attribute/Global.pm
Criterion Covered Total %
statement 6 17 35.2
branch 0 10 0.0
condition 0 12 0.0
subroutine 2 4 50.0
pod n/a
total 8 43 18.6


line stmt bran cond sub pod time code
1             package App::Config::Chronicle::Attribute::Global;
2              
3 1     1   3 use Moose;
  1         2  
  1         4  
4             extends 'App::Config::Chronicle::Attribute';
5              
6             =head1 NAME
7              
8             App::Config::Chronicle::Attribute::Global
9              
10             =cut
11              
12             sub _build_value {
13 0     0     my $self = shift;
14 0           my $value;
15 0 0 0       $value //= $self->data_set->{app_settings_overrides}->get($self->path) if ($self->data_set->{app_settings_overrides});
16 0 0 0       $value //= $self->data_set->{global}->get($self->path) if ($self->data_set->{global});
17 0 0 0       $value //= $self->data_set->{app_config}->get($self->path) if ($self->data_set->{app_config});
18 0 0 0       $value //= $self->definition->{default} if ($self->definition);
19              
20 0           return $value;
21             }
22              
23             sub _set_value {
24 0     0     my $self = shift;
25 0           my $value = shift;
26 0 0         $self->data_set->{global}->set($self->path, $value) if ($self->data_set->{global});
27 0           return;
28             }
29              
30 1     1   3892 no Moose;
  1         1  
  1         4  
31             __PACKAGE__->meta->make_immutable;
32              
33             1;