++ed by:
Toru Yamaguchi

NAME

MozRepl::Plugin::Base - Plugin base class.

VERSION

version 0.03

SYNOPSIS

    package MozRepl::Plugin::Foo::Bar;

    use strict;
    use warnings;

    use base qw(MozRepl::Plugin::Base);

    sub execute {
        my ($self, $ctx, $args) = @_;

        $ctx->execute(q|window.alert("Anta ga taisho!")|);
    }

    1;

    package main;

    use MozRepl;

    my $repl = MozRepl->new;
    $repl->setup({ plugins => { plugins => [qw/Foo::Bar/] } });
    $repl->foo_bar();

DESCRIPTION

This module is base class any plugins for MozRepl.

METHODS

new($args)

Create instance.

$args

Hash reference.

setup($ctx, @args)

Called from MozRepl setup() method. This is abstract method, If you want to task in setup pharse, then must be overriding this method.

$ctx

Context object. See MozRepl

@args

Extra parameters.

execute($ctx, @args)

Execute plugin method. Please override me.

$ctx

Context object. See MozRepl

@args

Extra parameters.

method_name()

If you override this method and return constant string, then the string will be used as method name in context.

Not overriding method name will be determined by MozRepl::Util plugin_to_method() method. See "plugin_to_method($plugin, $search)" in MozRepl::Util

process($name, $vars)

Processing template using by Template, Template::Provider::FromDATA.

$name

Label name in DATA Section.

$vars

Append values as hash reference.

SEE ALSO

MozRepl
Template
Template::Provider::FromDATA

AUTHOR

Toru Yamaguchi, <zigorou@cpan.org>

BUGS

Please report any bugs or feature requests to bug-mozrepl-plugin-base@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2007 Toru Yamaguchi, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.




Hosting generously
sponsored by Bytemark