NAME

Config::MVP::Reader - role to load MVP-style config from a file

VERSION

version 0.093120

DESCRIPTION

The config role provides some helpers for writing a configuration loader using the Config::MVP system to load and validate its configuration. It delegates assembly of the configuration sequence to an Assembler. The Reader is responsible for opening, reading, and interpreting a file.

ATTRIBUTES

assembler

The assembler attribute must be a Config::MVP::Assembler, has a sensible default that will handle the standard needs of a config loader. Namely, it will be pre-loaded with a starting section for root configuration. That starting section will alias author to authors and will set that up as a multivalue argument.

METHODS

build_assembler

This is the builder for the assembler attribute and must return a Config::MVP::Assembler object. It's here so subclasses can produce assemblers of other classes or with pre-loaded sections.

read_config

my $sequence = $reader->read_config(\%arg);

This method, which must be implemented by classes including this role, is passed a hashref of arguments and returns a Config::MVP::Sequence.

Valid arguments include:

root     - the name of the directory in which to look
filename - the filename in that directory to read

AUTHOR

Ricardo Signes <rjbs@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2009 by Ricardo Signes.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.