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 \*(C`is\*(C' to \*(C`ro\*(C'.

The module MooseX::HasDefaults::RW defaults \*(C`is\*(C' to \*(C`rw\*(C'.

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

AUTHOR

Shawn M Moore, \*(C`[email protected]\*(C'

RELATED TO MooseX::HasDefaults…

MooseX::AttributeDefaults

This requires its users to be \s-1MOP\s0 savvy, and is a bit too much typing for the common case of defaulting \*(C`is\*(C'.

MooseX::Attributes::Curried

This solves a similar need by letting users create sugar functions. But people like \*(C`has\*(C'.

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.