1Config::MVP::Assembler:U:sWeirthCBounntdrliebsu(t3e)d PeCrolnfDiogc:u:mMeVnPt:a:tAisosnembler::WithBundles(3)
2
3
4

NAME

6       Config::MVP::Assembler::WithBundles - a role to make assemblers expand
7       bundles
8

VERSION

10       version 2.200001
11

DESCRIPTION

13       Config::MVP::Assembler::WithBundles is a role to be composed into a
14       Config::MVP::Assembler subclass.  It allows some sections of
15       configuration to be treated as bundles.  When any section is ended, if
16       that section represented a bundle, its bundle contents will be unrolled
17       and will replace it in the sequence.
18
19       A package is considered a bundle if the this returns a defined method:
20
21         my $method = $assembler->package_bundle_method($package);
22
23       The default implementation looks for a method callde
24       "mvp_bundle_config", but "package_bundle_method" can be replaced to
25       allow for other bundle-identifying information.
26
27       Bundles are expanded by a call to the assembler's
28       "replace_bundle_with_contents" method, like this:
29
30         $assembler->replace_bundle_with_contents($section, $method);
31
32   replace_bundle_with_contents
33       The default "replace_bundle_with_contents" method deletes the section
34       from the sequence.  It then gets a description of the new sections to
35       introduce, like this:
36
37         my @new_config = $bundle_section->package->$method({
38           name    => $bundle_section->name,
39           package => $bundle_section->package,
40           payload => $bundle_section->payload,
41         });
42
43       (We pass a hashref rather than a section so that bundles can be
44       expanded synthetically without having to laboriously create a new
45       Section.)
46
47       The returned @new_config is a list of arrayrefs, each of which has
48       three entries:
49
50         [ $name, $package, $payload ]
51
52       Each arrayref is converted into a section in the sequence.  The
53       $payload should be an arrayref of name/value pairs to be added to the
54       created section.
55

AUTHOR

57       Ricardo Signes <rjbs@cpan.org>
58
60       This software is copyright (c) 2011 by Ricardo Signes.
61
62       This is free software; you can redistribute it and/or modify it under
63       the same terms as the Perl 5 programming language system itself.
64
65
66
67perl v5.12.3                      2011-02C-o1n1fig::MVP::Assembler::WithBundles(3)
Impressum