יובל קוג'מן (Yuval Kogman) > Object-Meta-Plugin-0.01 > Object::Meta::Plugin::ExportList

Download:
Object-Meta-Plugin-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.01   Source   Latest Release: Object-Meta-Plugin-0.02_04

NAME ^

Object::Meta::Plugin::ExportList - an implementation of a very simple, string only export list.

SYNOPSIS ^

        # the proper way

        my $plugin = GoodPlugin->new();
        $host->plug($plugin);

        package GoodPlugin;

        # ...

        sub exports {
                qw/some methods/;
        }

        sub init {
                my $self = shift;
                return Object::Meta::Plugin::ExportList->new($self};
        }

        # or if you prefer.... *drum roll*
        # the naughty way

        my $plugin = BadPlugin->new();  # doesn't need to be a plugin per se, since
                                                                        # it's not verified by plug(). All it needs
                                                                        # is to have a working can(). the export
                                                                        # list is responsible for the rest.
                                                                        # in short, this way init() needn't be defined.

        my $export = Object::Meta::Plugin::ExportList->new($plugin, qw/foo bar/);

        $host->register($export);

DESCRIPTION ^

An export list is an object a plugin hands over to a host, stating what it is going to give it. This is a very basic implementation, providing only the bare minimum methods needed to register a plugin. Unregistering one requires even less.

METHODS ^

new PLUGIN [ METHODS ... ]

Creates a new export list object. When passed only a plugin, and no method names as additional arguments,

plugin

Returns the reference to the plugin object it represents.

exists METHOD

Returns truth if the method stated is exported.

list METHOD

Returns a list of exported method names.

merge EXPORTLIST

Performs an OR with the methods of the argued export list.

unmerge EXPORTLIST

Performs an AND of the COMPLEMENT of the argued export list.

CAVEATS ^

BUGS ^

Not that I know of, for the while being at least.

COPYRIGHT & LICENSE ^

        Copyright 2003 Yuval Kogman. All rights reserved.
        This program is free software; you can redistribute it
        and/or modify it under the same terms as Perl itself.

AUTHOR ^

Yuval Kogman <nothingmuch@woobling.org>

SEE ALSO ^

Object::Meta::Plugin, Object::Meta::Plugin::Useful, Object::Meta::Plugin::Host

syntax highlighting: