lib/Apache/SiteConfig/Statement.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 1 | 3 | 33.3 |
branch | n/a | ||
condition | n/a | ||
subroutine | 1 | 1 | 100.0 |
pod | n/a | ||
total | 2 | 4 | 50.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Apache::SiteConfig::Statement; | ||||||
2 | 2 | 2 | 2041 | use Moose; | |||
0 | |||||||
0 | |||||||
3 | |||||||
4 | has parent => ( is => 'rw' ); | ||||||
5 | |||||||
6 | sub get_level { | ||||||
7 | my ($self) = @_; | ||||||
8 | my $cnt = 0; | ||||||
9 | my $p = $self->parent; | ||||||
10 | $cnt++ if $p; | ||||||
11 | while( $p && $p->parent ) { | ||||||
12 | $p = $p->parent; | ||||||
13 | $cnt++; | ||||||
14 | } | ||||||
15 | |||||||
16 | return $cnt; | ||||||
17 | } | ||||||
18 | |||||||
19 | 1; |