File Coverage

blib/lib/Forest/Tree/Builder/Callback.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 12 13 92.3


line stmt bran cond sub pod time code
1             package Forest::Tree::Builder::Callback;
2 10     10   12506 use Moose::Role;
  10         28  
  10         102  
3              
4             our $VERSION = '0.10';
5             our $AUTHORITY = 'cpan:STEVAN';
6              
7             with 'Forest::Tree::Builder' => { -excludes => [qw(create_new_subtree)] };
8              
9             has new_subtree_callback => (
10             isa => "CodeRef|Str",
11             is => "ro",
12             required => 1,
13             default => "Forest::Tree::Constructor::create_new_subtree",
14             );
15              
16             sub create_new_subtree {
17 76     76 0 211 my ( $self, @args ) = @_;
18              
19 76         4277 my $method = $self->new_subtree_callback;
20              
21 76         694 $self->$method(@args);
22             }
23              
24 10     10   103324 no Moose::Role; 1;
  10         28  
  10         64  
25              
26             __END__
27              
28             =pod
29              
30             =head1 NAME
31              
32             Forest::Tree::Builder::Callback - A Forest tree builder with a callback for subtree construction
33              
34             =head1 DESCRIPTION
35              
36             TODO
37              
38             =head1 BUGS
39              
40             All complex software has bugs lurking in it, and this module is no
41             exception. If you find a bug please either email me, or add the bug
42             to cpan-RT.
43              
44             =head1 AUTHOR
45              
46             Yuval Kogman
47              
48             =head1 COPYRIGHT AND LICENSE
49              
50             Copyright 2008-2014 Infinity Interactive, Inc.
51              
52             L<http://www.iinteractive.com>
53              
54             This library is free software; you can redistribute it and/or modify
55             it under the same terms as Perl itself.
56              
57             =cut