sukria/Dancer — pull request #761 by Ovid (2012-03-21 11:21:48+00:00)
Title: Allow the config to optionally return objects instead of hashrefs.

Per a discussion on the mailing list, if "strict_config" is set to true in the configuration, the config() returns an object (which is still a hasref and thus backwards compatible).

Instead of calling something like this (and the potentially weird runtime error if you misspelled those key names):

my $pass = config->{auth}{pass};

You can call this:

my $pass = config->auth->pass;

If you've misspelled any method name, you get a useful error message tell you the attribute you've misspelled and the available attributes:

Can't locate config attribute "pass".
Available attributes: password, username

I've updated the docs and tests for this feature are in t/01_config/07_strict_config.t

Cheers,
Ovid