File Coverage

blib/lib/App/Config/Chronicle/Node.pm
Criterion Covered Total %
statement 8 8 100.0
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 13 92.3


line stmt bran cond sub pod time code
1             package App::Config::Chronicle::Node;
2              
3 1     1   422 use Moose;
  1         1  
  1         5  
4              
5             our $VERSION = '0.06'; ## VERSION
6              
7             =head1 NAME
8              
9             App::Config::Chronicle::Node
10              
11             =head1 DESCRIPTION
12              
13             This module represents a node in app_config tree
14              
15             =head1 ATTRIBUTES
16              
17             =cut
18              
19             =head2 name
20              
21             short name of the node
22              
23             =cut
24              
25             has name => (
26             is => 'ro',
27             isa => 'Str',
28             required => 1,
29             );
30              
31             =head2 parent_path
32              
33             path in dot notation of the parent node.
34              
35             =cut
36              
37             has parent_path => (
38             is => 'ro',
39             isa => 'Str',
40             );
41              
42             =head2 path
43              
44             path in dot notation of the current node.
45              
46             =cut
47              
48             has path => (
49             is => 'ro',
50             isa => 'Str',
51             lazy_build => 1,
52             );
53              
54             sub _build_path {
55 1     1   2 my $self = shift;
56 1 50       29 return (($self->parent_path) ? $self->parent_path . '.' : '') . $self->name;
57             }
58              
59             =head2 definition
60              
61             definition of this node from definitions.yml
62              
63             =cut
64              
65             has 'definition' => (
66             is => 'ro',
67             isa => 'HashRef',
68             required => 1,
69             );
70              
71             has 'data_set' => (
72             is => 'ro',
73             required => 1,
74             );
75              
76 1     1   4327 no Moose;
  1         1  
  1         4  
77             __PACKAGE__->meta->make_immutable;
78              
79             1;