Created
December 1, 2014 11:56
-
-
Save domm/af231b16521e05943c5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
container 'Config' => as { | |
service 'config' => ( | |
lifecycle => "Singleton", | |
class => 'Config::JFDI', | |
dependencies => { | |
name => service( name => "your_app_name" ), | |
path => '/Path/etc', | |
}, | |
); | |
}; | |
container 'SomethingNeedingConfig' => as { | |
service 'some_service' => ( | |
lifecycle => "Singleton", | |
class => 'Some::Class', | |
dependencies => { config => '/Config/config' }, | |
block => sub { | |
my $s = shift; | |
my $from_config = $s->param('config') | |
->get->{'some'}{'key'}; | |
return Some::Class->new( foo => $from_config); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment