File Coverage

lib/Config/Proxy/Node/Root.pm
Criterion Covered Total %
statement 17 23 73.9
branch n/a
condition n/a
subroutine 6 9 66.6
pod 4 5 80.0
total 27 37 72.9


line stmt bran cond sub pod time code
1             package Config::Proxy::Node::Root;
2 7     7   43 use strict;
  7         11  
  7         285  
3 7     7   33 use warnings;
  7         45  
  7         596  
4 7     7   42 use parent 'Config::Proxy::Node::Section';
  7         12  
  7         69  
5 7     7   437 use Carp;
  7         12  
  7         1697  
6              
7             =head1 NAME
8              
9             Config::Proxy::Node::Root - root node of proxy configuration parse tree
10              
11             =head1 DESCRIPTION
12              
13             Objects of this class represent the topmost node in proxy configuration tree.
14             Each parse tree contains exactly one object of this class. This node can be
15             reached from every node in the tree by following its B attribute
16             and is returned by the B method of B class.
17              
18             =cut
19              
20             sub new {
21 24     24 0 47 my $class = shift;
22 24         117 my $self = $class->SUPER::new(@_);
23 24         72 $self->{dirty} = 0;
24 24         156 return $self;
25             }
26              
27             =head1 METHODS
28              
29             This class inherits methods from L, which
30             see.
31              
32             =head2 is_root
33              
34             Always true.
35              
36             =cut
37              
38 9     9 1 27 sub is_root { 1 }
39              
40             =head2 is_dirty
41              
42             $bool = $node->is_dirty;
43              
44             Returns true if the tree is C, i.e. it was modified since it has been
45             created from the disk configuration file.
46              
47             =cut
48              
49             sub is_dirty {
50 0     0 1   my $self = shift;
51             return $self->{dirty}
52 0           }
53              
54             =head2 mark_dirty
55              
56             $node->mark_dirty;
57              
58             Sets the C attribute.
59              
60             =cut
61              
62             sub mark_dirty {
63 0     0 1   my $self = shift;
64 0           $self->{dirty} = 1;
65             }
66              
67             =head2 clear_dirty
68              
69             $node->clear_dirty;
70              
71             Clears the C attribute.
72              
73             =cut
74              
75             sub clear_dirty {
76 0     0 1   my $self = shift;
77 0           $self->{dirty} = 0;
78             }
79              
80             =head1 SEE ALSO
81              
82             L, L.
83              
84             =cut
85              
86             1;
87              
88