1Test::Stream::Exporter:U:sMeertaC(o3n)tributed Perl DocuTmeesntt:a:tSitorneam::Exporter::Meta(3)
2
3
4
6 Test::Stream::Exporter::Meta - Meta object for exporters.
7
9 This distribution is deprecated in favor of Test2, Test2::Suite, and
10 Test2::Workflow.
11
12 See Test::Stream::Manual::ToTest2 for a conversion guide.
13
15 Test::Stream::Exporter uses this package to manage exports.
16
17 Every package that uses "Test::Stream::Exporter" has a
18 "Test::Stream::Exporter::Meta" object created for it which contains the
19 metadata about the available exports and the kind of export they are.
20
22 $meta = Test::Stream::Exporter::Meta::get( $PACKAGE )
23 Returns a "metaobject" for $PACKAGE if one exists. Returns "undef"
24 if one does not exist. This can be used as either a method or a
25 function, the last argument is the only one that is used.
26
28 $meta = Test::Stream::Exporter::Meta->new( $PACKAGE )
29 Constructs a "metaobject" for $PACKAGE and returns it. If one
30 already exists, it is returned.
31
32 $meta->add( $DEFAULT, $SUBNAME )
33 $meta->add( $DEFAULT, $SUBNAME => $SUBREF )
34 Add an export named $SUBNAME. If a ref is provided it will be used,
35 otherwise it will grab the sub from the package using $SUBNAME. The
36 fist argument is a toggle, true means the sub is exported by
37 default, false means it is not exported by default.
38
39 $meta->add_bulk( $DEFAULT, $SUBNAME, $SUBNAME, ... )
40 Add all the subnames given as arguments to the list of exports. The
41 subs of the given names are taken as the references. The first
42 argument is a toggle, true means the susb should be exported by
43 default, false means they should not be.
44
45 $default_ref = $meta->default()
46 Get the arrayref of default exports. This is not a copy of the
47 arrayref, modifying this would modify the internal list of
48 defaults.
49
50 $exports_ref = $meta->exports()
51 Returns a "HASHREF" of "$SUBNAME => $CODEREF" values of all
52 avialable exports.
53
55 The source code repository for Test::Stream can be found at
56 http://github.com/Test-More/Test-Stream/.
57
59 Chad Granum <exodist@cpan.org>
60
62 Chad Granum <exodist@cpan.org>
63 Kent Fredric <kentnl@cpan.org>
64
66 Copyright 2015 Chad Granum <exodist7@gmail.com>.
67
68 This program is free software; you can redistribute it and/or modify it
69 under the same terms as Perl itself.
70
71 See http://dev.perl.org/licenses/
72
73
74
75perl v5.36.0 2023-01-20 Test::Stream::Exporter::Meta(3)