1Exporter::Declare::MetaU(s3e)r Contributed Perl DocumentaEtxipoonrter::Declare::Meta(3)
2
3
4
6 Exporter::Declare::Meta - The meta object which stores meta-data for
7 all exporters.
8
10 All classes that use Exporter::Declare have an associated Meta object.
11 Meta objects track available exports, tags, and options.
12
14 $class->new( $package )
15 Created a meta object for the specified package. Also injects the
16 export_meta() sub into the package namespace that returns the
17 generated meta object.
18
19 $class->new_from_exporter( $package )
20 Create a meta object for a package that already uses Exporter.pm.
21 This will not turn the class into an Exporter::Declare package, but
22 it will create a meta object and export_meta() method on it. This
23 si primarily used for reexport purposes.
24
25 $package = $meta->package()
26 Get the name of the package with which the meta object is
27 associated.
28
29 $meta->add_alias()
30 Usually called at construction to add a package alias function to
31 the exports.
32
33 $meta->add_export( $name, $ref )
34 Add an export, name should be the item name with sigil (assumed to
35 be sub if there is no sigil). $ref should be a ref blessed as an
36 Exporter::Declare::Export subclass.
37
38 $meta->get_export( $name )
39 Retrieve the Exporter::Declare::Export object by name. Name should
40 be the item name with sigil, assumed to be sub when sigil is
41 missing.
42
43 $meta->export_tags_push( $name, @items )
44 Add @items to the specified tag. Tag will be created if it does not
45 already exist. $name should be the tag name WITHOUT -/: prefix.
46
47 @list = $meta->export_tags_get( $name )
48 Get the list of items associated with the specified tag. $name
49 should be the tag name WITHOUT -/: prefix.
50
51 @list = $meta->export_tags_list()
52 Get a list of all export tags.
53
54 $bool = $meta->is_tag( $name )
55 Check if a tag with the given name exists. $name should be the tag
56 name WITHOUT -/: prefix.
57
58 $meta->options_add( $name )
59 Add import options by name. These will be boolean options that take
60 no arguments.
61
62 my @list = $meta->options_list()
63 $meta->arguments_add( $name )
64 Add import options that slurp in the next argument as a value.
65
66 $bool = $meta->is_option( $name )
67 Check if the specified name is an option.
68
69 $bool = $meta->is_argument( $name )
70 Check if the specified name is an option that takes an argument.
71
72 $meta->add_parser( $name, sub { ... })
73 Add a parser sub that should be associated with exports via
74 Devel::Declare
75
76 $meta->get_parser( $name )
77 Get a parser by name.
78
79 $ref = $meta->get_ref_from_package( $item )
80 Returns a reference to a specific package variable or sub.
81
82 $meta->reexport( $package )
83 Re-export the exports in the provided package. Package may be an
84 Exporter::Declare based package or an Exporter based package.
85
86 $meta->merge( $meta2 )
87 Merge-in the exports and tags of the second meta object.
88
90 Chad Granum exodist7@gmail.com
91
93 Copyright (C) 2010 Chad Granum
94
95 Exporter-Declare is free software; Standard perl licence.
96
97 Exporter-Declare is distributed in the hope that it will be useful, but
98 WITHOUT ANY WARRANTY; without even the implied warranty of
99 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license
100 for more details.
101
102
103
104perl v5.28.1 2019-02-02 Exporter::Declare::Meta(3)