MooseX::HasDefaults - default "is" to "ro" or "rw" for all attributes


MooseX-HasDefaults documentation  | view source Contained in the MooseX-HasDefaults distribution.

Index


NAME

Top

MooseX::HasDefaults - default "is" to "ro" or "rw" for all attributes

SYNOPSIS

Top

    package Person;
    use Moose;
    use MooseX::HasDefaults::RO;

    has name => (
        isa => 'Str',
    );

    has age => (
        is  => 'rw',
        isa => 'Int',
        documentation => "Changes most years",
    );

DESCRIPTION

Top

The module MooseX::HasDefaults::RO defaults is to ro.

The module MooseX::HasDefaults::RW defaults is to rw.

If you pass a specific value to any has's is, that overrides the default. If you do not want an accessor, pass is => undef.

AUTHOR

Top

Shawn M Moore, sartak@gmail.com

SEE ALSO

Top

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

Top


MooseX-HasDefaults documentation  | view source Contained in the MooseX-HasDefaults distribution.