Tangerine::HookData - An envelope for data returned from a hook
my $data = Tangerine::HookData->new( modules => { 'ExtUtils::MakeMaker' => [ Tangerine::Occurence->new( line => 3, version => '6.30', ), ], }, hooks => [ Tangerine::Hook->new( type => 'compile', run => \&Tangerine::hook::myhook::run, ), ], children => [ qw/myhook_statement with_args ;/ ] );
Hooks use this class to encapsulate their results before returning them to the main Tangerine object.
A hook may return a hash reference of module names pointing to lists of Tangerine::Occurence objects, a list reference of Tangerine::Hook objects that should be added to the list of hooks to run and a statement which should be parsed in the context of the current line.
children
Returns or sets the statement to be analysed. This is a simple list reference of significant children. Tangerine statements are created from PPI::Statement's schildren method.
schildren
hooks
Returns or sets a list reference of Tangerine::Hook hooks to be run.
modules
Returns or sets a hash reference of module names pointing to list references of Tangerine::Occurence objects.
type
Forces the data type, overriding the hook's type value. The possible values being package, compile, or runtime.
package
compile
runtime
Tangerine, Tangerine::Hook, Tangerine::Occurence, PPI::Statement
Petr Šabata <contyk@redhat.com>
Copyright (c) 2014-2016 Petr Šabata
See LICENSE for licensing details.
To install Tangerine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tangerine
CPAN shell
perl -MCPAN -e shell install Tangerine
For more information on module installation, please visit the detailed CPAN module installation guide.