| 1 | package Forest::Tree::Roles::HasNodeFormatter; | ||||||||||
| 2 | 5 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 5 | our $VERSION = '0.10'; | |||||||||
| 5 | 5 | our $AUTHORITY = 'cpan:STEVAN'; | |||||||||
| 6 | |||||||||||
| 7 | has 'node_formatter' => ( | ||||||||||
| 8 | is => 'rw', | ||||||||||
| 9 | isa => 'CodeRef|Str', | ||||||||||
| 10 | lazy => 1, | ||||||||||
| 11 | 15 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.2
| |||||||||||
| 12 | 122 | ▶ | sub { (shift)->node || 'undef' } | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||
| 13 | 15 | } | |||||||||
| 14 | 5 | ); | |||||||||
| 15 | |||||||||||
| 16 | 162 | ▶ | sub format_node { | ||||||||
|
Subroutine
format_node: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 17 | 162 | my ( $self, $node, @args ) = @_; | |||||||||
| 18 | |||||||||||
| 19 | 162 | my $fmt = $self->node_formatter; | |||||||||
| 20 | |||||||||||
| 21 | 162 | $node->$fmt(@args); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 5 | ▶ | no Moose::Role; 1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | |||||||||||
| 26 | __END__ | ||||||||||