Bolts::Role::Opaque - Make a bag/artifact opaque to acquisition
version 0.143171
package MyApp::Secrets; use Moose; with 'Bolts::Role::Opaque'; sub foo { "secret" } package MyApp; use Bolts; artifact 'secrets' => ( class => 'MyApp::Secrets', ); my $bag = MyApp->new; my $secrets = $bag->acquire('secrets'); # OK! my $foo = $secrets->foo; # OK! # NO NO NO! Croaks. my $foo_direct = $bag->acquire('secrets', 'foo'); # NO!
Marks an artifact/bag so that the item cannot be reached via the acquire method.
acquire
Why? I don't know. It seemed like a good idea.
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
This software is copyright (c) 2014 by Qubling Software LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Bolts, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bolts
CPAN shell
perl -MCPAN -e shell install Bolts
For more information on module installation, please visit the detailed CPAN module installation guide.