| 1 | package Tree::Simple::VisitorFactory; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | our $VERSION = '0.16'; | |||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 9 | 1 | my ($class) = @_; | |||||||||
| 10 | 1 | return bless \$class; | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | 4 | ▶ | sub get { | ||||||||
|
Subroutine
get: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 14 | 4 | my ($class, $visitor) = @_; | |||||||||
| 15 | 4 | ▶ | (defined($visitor)) || die "Insufficient Arguments : You must specify a Visitor to load"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 3 | $visitor = "Tree::Simple::Visitor::$visitor"; | |||||||||
| 17 | 3 | eval "require $visitor"; | |||||||||
| 18 | 3 | ▶ | die "Illegal Operation : Could not load Visitor ($visitor) because $@" if $@; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 2 | return $visitor->new(); | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 2 | *getVisitor = \&get; | |||||||||
| 23 | |||||||||||
| 24 | 2 | 1; | |||||||||
| 25 | |||||||||||
| 26 | __END__ | ||||||||||