-
-
24 Jul 2010 03:59:28 UTC
- Distribution: MooseX-HasDefaults
- Module version: 0.03
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (1)
- Testers (9043 / 5 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (18.45KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Moose
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
MooseX::HasDefaults - default "is" to "ro" or "rw" for all attributes
SYNOPSIS
package Person; use Moose; use MooseX::HasDefaults::RO; has name => ( isa => 'Str', ); has age => ( is => 'rw', isa => 'Int', documentation => "Changes most years", );
DESCRIPTION
The module MooseX::HasDefaults::RO defaults
is
toro
.The module MooseX::HasDefaults::RW defaults
is
torw
.If you pass a specific value to any
has
'sis
, that overrides the default. If you do not want an accessor, passis => undef
.AUTHOR
Shawn M Moore,
sartak@gmail.com
SEE ALSO
- MooseX::AttributeDefaults
-
This requires its users to be MOP savvy, and is a bit too much typing for the common case of defaulting
is
. - MooseX::Attributes::Curried
-
This solves a similar need by letting users create sugar functions. But people like
has
.
COPYRIGHT AND LICENSE
Copyright 2009 Infinity Interactive
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install MooseX::HasDefaults, copy and paste the appropriate command in to your terminal.
cpanm MooseX::HasDefaults
perl -MCPAN -e shell install MooseX::HasDefaults
For more information on module installation, please visit the detailed CPAN module installation guide.