1Config::MVP::Section(3)User Contributed Perl DocumentatioCnonfig::MVP::Section(3)
2
3
4

NAME

6       Config::MVP::Section - one section of an MVP configuration sequence
7

VERSION

9       version 2.200012
10

DESCRIPTION

12       For the most part, you can just consult Config::MVP to understand what
13       this class is and how it's used.
14

ATTRIBUTES

16   name
17       This is the section's name.  It's a string, and it must be provided.
18
19   package
20       This is the (Perl) package with which the section is associated.  It is
21       optional.  When the section is instantiated, it will ensure that this
22       package is loaded.
23
24   multivalue_args
25       This attribute is an arrayref of value names that should be considered
26       multivalue properties in the section.  When added to the section, they
27       will always be wrapped in an arrayref, and they may be added to the
28       section more than once.
29
30       If this attribute is not given during construction, it will default to
31       the result of calling section's package's "mvp_multivalue_args" method.
32       If the section has no associated package or if the package doesn't
33       provide that method, it default to an empty arrayref.
34
35   aliases
36       This attribute is a hashref of name remappings.  For example, if it
37       contains this hashref:
38
39         {
40           file => 'files',
41           path => 'files',
42         }
43
44       Then attempting to set either the "file" or "path" setting for the
45       section would actually set the "files" setting.
46
47       If this attribute is not given during construction, it will default to
48       the result of calling section's package's "mvp_aliases" method.  If the
49       section has no associated package or if the package doesn't provide
50       that method, it default to an empty hashref.
51
52   payload
53       This is the storage into which properties are set.  It is a hashref of
54       names and values.  You should probably not alter the contents of the
55       payload, and should read its contents only.
56
57   is_finalized
58       This attribute is true if the section has been marked finalized, which
59       will prevent any new values from being added to it.  It can be set with
60       the "finalize" method.
61
62   sequence
63       This attributes points to the sequence into which the section has been
64       assembled.  It may be unset if the section has been created but not yet
65       placed in a sequence.
66

METHODS

68   add_value
69         $section->add_value( $name => $value );
70
71       This method sets the value for the named property to the given value.
72       If the property is a multivalue property, the new value will be pushed
73       onto the end of an arrayref that will store all values for that
74       property.
75
76       Attempting to add a value for a non-multivalue property whose value was
77       already added will result in an exception.
78
79   load_package
80         $section->load_package($package, $section_name);
81
82       This method is used to ensure that the given $package is loaded, and is
83       called whenever a section with a package is created.  By default, it
84       delegates to Class::Load.  If the package can't be found, it calls the
85       missing_package method.  Errors in compilation are not suppressed.
86
87   missing_package
88         $section->missing_package($package, $section_name);
89
90       This method is called when "load_package" encounters a package that is
91       not installed.  By default, it throws an exception.
92

AUTHOR

94       Ricardo Signes <rjbs@cpan.org>
95
97       This software is copyright (c) 2021 by Ricardo Signes.
98
99       This is free software; you can redistribute it and/or modify it under
100       the same terms as the Perl 5 programming language system itself.
101
102
103
104perl v5.32.1                      2021-01-27           Config::MVP::Section(3)
Impressum