NAME
Tangerine::HookData - An envelope for data returned from a hook
SYNOPSIS
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 ;/ ]
);
DESCRIPTION
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.
METHODS
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. 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
, orruntime
.
SEE ALSO
Tangerine, Tangerine::Hook, Tangerine::Occurence, PPI::Statement
AUTHOR
Petr Šabata <contyk@redhat.com>
COPYRIGHT AND LICENSE
Copyright (c) 2014-2016 Petr Šabata
See LICENSE for licensing details.