logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Author

       Shawn M Moore, "sartak@gmail.com"

Description

       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".

Name

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

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".

Synopsis

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

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

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

See Also