| 1 | package Forest::Tree::Builder; | ||
| 2 | 10 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 10 | our $VERSION = '0.10'; | |
| 5 | 10 | our $AUTHORITY = 'cpan:STEVAN'; | |
| 6 | |||
| 7 | 10 | with qw(Forest::Tree::Constructor); | |
| 8 | |||
| 9 | 10 | has 'tree' => ( | |
| 10 | is => 'ro', | ||
| 11 | writer => "_tree", | ||
| 12 | isa => 'Forest::Tree::Pure', | ||
| 13 | lazy_build => 1, | ||
| 14 | ); | ||
| 15 | |||
| 16 | 10 | has tree_class => ( | |
| 17 | isa => "ClassName", | ||
| 18 | is => "ro", | ||
| 19 | reader => "_tree_class", | ||
| 20 | default => "Forest::Tree", | ||
| 21 | ); | ||
| 22 | |||
| 23 | # horrible horrible kludge to satisfy 'requires' without forcing 'sub | ||
| 24 | # tree_class {}' in every single class. God i hate roles and attributes | ||
| 25 | 0 | ▶ | sub tree_class { shift->_tree_class(@_) } |
|
Subroutine
tree_class: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 26 | |||
| 27 | 0 | ▶ | sub _build_tree { |
|
Subroutine
_build_tree: not called CC=1 SCAR=6.9
| |||
| 28 | 0 | my $self = shift; | |
| 29 | |||
| 30 | 0 | $self->create_new_subtree( | |
| 31 | children => $self->subtrees, | ||
| 32 | ); | ||
| 33 | } | ||
| 34 | |||
| 35 | 10 | has subtrees => ( | |
| 36 | isa => "ArrayRef[Forest::Tree::Pure]", | ||
| 37 | is => "ro", | ||
| 38 | lazy_build => 1, | ||
| 39 | ); | ||
| 40 | |||
| 41 | 10 | requires "_build_subtrees"; | |
| 42 | |||
| 43 | # ex: set sw=4 et: | ||
| 44 | |||
| 45 | 10 | ▶ | no Moose::Role; 1; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 46 | |||
| 47 | __END__ | ||