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   88548 use Moose;
  1         305197  
  1         6  
4             extends 'App::Config::Chronicle::Attribute';
5              
6             our $VERSION = '0.06'; ## VERSION
7              
8             =head1 NAME
9              
10             App::Config::Chronicle::Attribute::Global
11              
12             =cut
13              
14             sub _build_value {
15 0     0     my $self = shift;
16 0           my $value;
17 0 0 0       $value //= $self->data_set->{app_settings_overrides}->get($self->path) if ($self->data_set->{app_settings_overrides});
18 0 0 0       $value //= $self->data_set->{global}->get($self->path) if ($self->data_set->{global});
19 0 0 0       $value //= $self->data_set->{app_config}->get($self->path) if ($self->data_set->{app_config});
20 0 0 0       $value //= $self->definition->{default} if ($self->definition);
21              
22 0           return $value;
23             }
24              
25             sub _set_value {
26 0     0     my $self = shift;
27 0           my $value = shift;
28 0 0         $self->data_set->{global}->set($self->path, $value) if ($self->data_set->{global});
29 0           return;
30             }
31              
32 1     1   5038 no Moose;
  1         1  
  1         4  
33             __PACKAGE__->meta->make_immutable;
34              
35             1;