Name : perl-MooseX-Attribute-ENV
| |
Version : 0.02
| Vendor : obs://build_opensuse_org/home:M0ses
|
Release : lp150.7.3
| Date : 2017-10-03 14:00:00
|
Group : Development/Libraries/Perl
| Source RPM : perl-MooseX-Attribute-ENV-0.02-lp150.7.3.src.rpm
|
Size : 0.01 MB
| |
Packager : (none)
| |
Summary : Set default of an attribute to a value from %ENV
|
Description :
This is a Moose attribute trait that you use when you want the default value for an attribute to be populated from the %ENV hash. So, for example if you have set the environment variable USERNAME = \'John\' you can do:
package MyApp::MyClass;
use Moose; use MooseX::Attribute::ENV;
has \'username\' => (is=>\'ro\', traits=>[\'ENV\']);
package main;
my $myclass = MyApp::MyClass->new();
print $myclass->username; # STDOUT => \'John\';
This is basically similar functionality to something like:
has \'attr\' => ( is=>\'ro\', default=> sub { $ENV{uc \'attr\'}; }, );
but this module has a few other features that offer merit, as well as being a simple enough attribute trait that I hope it can serve as a learning tool.
If the named key isn\'t found in %ENV, then defaults will execute as normal.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/home:/M0ses:/Perl/openSUSE_Leap_15.0/noarch |
Hmm ... It's impossible ;-) This RPM doesn't exist on any FTP server
Provides :
perl(Moose::Meta::Attribute::Custom::Trait::ENV)
perl(MooseX::Attribute::ENV)
perl-MooseX-Attribute-ENV
Requires :