.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Config::MVP::Assembler::WithBundles 3" .TH Config::MVP::Assembler::WithBundles 3 2026-10-25 "perl v5.44.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH DESCRIPTION .IX Header "DESCRIPTION" Config::MVP::Assembler::WithBundles is a role to be composed into a Config::MVP::Assembler subclass. It allows some sections of configuration to be treated as bundles. When any section is ended, if that section represented a bundle, its bundle contents will be unrolled and will replace it in the sequence. .PP A package is considered a bundle if \f(CW\*(C`package_bundle_method\*(C'\fR returns a defined value (which is the name of a method that will be called on that package to retrieve its bundle config). .PP .Vb 1 \& my $method = $assembler\->package_bundle_method($package); .Ve .PP The default implementation looks for a method called \f(CW\*(C`mvp_bundle_config\*(C'\fR, but \&\f(CW\*(C`package_bundle_method\*(C'\fR can be replaced with one that returns the name of a different bundle\-identifying method\-name. .PP Bundles are expanded by a call to the assembler\*(Aqs \&\f(CW\*(C`replace_bundle_with_contents\*(C'\fR method, like this: .PP .Vb 1 \& $assembler\->replace_bundle_with_contents($section, $method); .Ve .SS replace_bundle_with_contents .IX Subsection "replace_bundle_with_contents" The default \f(CW\*(C`replace_bundle_with_contents\*(C'\fR method deletes the section from the sequence. It then gets a description of the new sections to introduce, like this: .PP .Vb 5 \& my @new_config = $bundle_section\->package\->$method({ \& name => $bundle_section\->name, \& package => $bundle_section\->package, \& payload => $bundle_section\->payload, \& }); .Ve .PP (We pass a hashref rather than a section so that bundles can be expanded synthetically without having to laboriously create a new Section.) .PP The returned \f(CW@new_config\fR is a list of arrayrefs, each of which has three entries: .PP .Vb 1 \& [ $name, $package, $payload ] .Ve .PP Each arrayref is converted into a section in the sequence. The \f(CW$payload\fR should be an arrayref of name/value pairs to be added to the created section.