line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tree::Object::Hash; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2016-03-30'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.06'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
21598
|
use 5.010001; |
|
1
|
|
|
|
|
2
|
|
7
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
15
|
|
8
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
16
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
379
|
use Role::Tiny::With; |
|
1
|
|
|
|
|
3729
|
|
|
1
|
|
|
|
|
150
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Role::TinyCommons::Tree::NodeMethods'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
13
|
|
|
13
|
1
|
2321
|
my $class = shift; |
16
|
13
|
|
|
|
|
15
|
my %attrs = @_; |
17
|
13
|
|
50
|
|
|
35
|
$attrs{_parent} //= undef; |
18
|
13
|
|
50
|
|
|
28
|
$attrs{_children} //= []; |
19
|
13
|
|
|
|
|
20
|
bless \%attrs, $class; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub parent { |
23
|
123
|
|
|
123
|
1
|
31531
|
my $self = shift; |
24
|
123
|
100
|
|
|
|
225
|
$self->{_parent} = $_[0] if @_; |
25
|
123
|
|
|
|
|
181
|
$self->{_parent}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub children { |
29
|
140
|
|
|
140
|
1
|
4170
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
140
|
100
|
|
|
|
189
|
$self->{_children} = $_[0] if @_; |
32
|
140
|
|
|
|
|
223
|
$self->{_children}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
# ABSTRACT: A hash-based tree object |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |