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 => 'use',
            run => \&Tangerine::hook::myhook::run
        )
    ],
    statement => [ qw/myhook_statement with_args ;/ ]
);

DESCRIPTION

Hooks used this class to encapsulate their results before returning them to the 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 analysed in the context of the current line.

METHODS

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.

statement

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.

SEE ALSO

Tangerine, Tangerine::Hook, Tangerine::Occurence, PPI::Statement

AUTHOR

Petr Šabata <contyk@redhat.com>

COPYRIGHT AND LICENSE

Copyright (c) 2014 Petr Šabata

See LICENSE for licensing details.