The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SweetPea::Application::Config - Configuration handling for SweetPea-Application.

SYNOPSIS ... from inside SweetPea::Application or a Controller; my $configuration = $s->config->get('/application'); my $datasources = $s->config->get('/datasourses');

METHODS

new

    The new method instantiates a new SweetPea::Application::Config object
    which use Config::Any as a base class to provide access to the yml documents.
    
    $s->plug( 'config', sub { return SweetPea::Application::Config->new($s); });

get

    The get method returns a reference to the specific configuration data of
    the key passed to it or returns undefined.
    
    my $foo = $s->config->get('/application');
    if (defined $foo) {
        $foo->{datasource} = 'production';
    }
    else {
        die '/application config file is undefined';
    }

set

    The set method saves any changes to the configuration data of the file
    identified by the key passed to it or returns undefined.

AUTHOR

Al Newkirk, <al.newkirk at awnstudio.com>