PDT::Config - Base class for PDT configuration objects.
This module is currently in the early stages. For the latest please check the github page at http://github.com/exodist/PDT
The base class for all PDT configuration objects.
package App::PDT::MyClass::Config; use strict; use warnings; use base 'PDT::Config'; sub defaults {{ key => 'value' }} sub configs {[ '/path/to/config.yaml', ... ]} sub params {[qw/ param1 param2 ... /]} __PACKAGE__->subclass; 1;
These are class methods you usually want to override.
Returns a hash with key value pairs to act as default config options.
Returns a list of default locations for config files.
Returns a list fo all params recognised by this config class.
Should always be called using your subclass. This method will create accessor methods for all parameters spefied in your overriden params() method.
Create a new instance. Parameters should be key => 'value'. A config file can be specified using the 'file' key.
Get/Override the value of the parameter.
$name is mandatory, $value is optional.
Sources values in this order, if a source is 'undef' it will move on to the next.
1. overrides 2. config file 3. defaults
Returns the overrides hash.
Returns the hash read from the config file.
Chad Granum exodist7@gmail.com
Copyright (C) 2010 Chad Granum
PDT-Config is free software; Standard perl licence.
PDT-Config is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install PDT::Config, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PDT::Config
CPAN shell
perl -MCPAN -e shell install PDT::Config
For more information on module installation, please visit the detailed CPAN module installation guide.