- SEE ALSO
- COPYRIGHT AND LICENSE
Moose::Micro - succinctly specify Moose attributes
package MyClass; use Moose::Micro 'foo $bar @baz; %!quux';
Moose::Micro makes it easy to declare Moose attributes without a lot of typing.
The argument to
use Moose::Micro is a list of attribute names, which is split on whitespace. Any attributes named before the (optional) semicolon are required; any after it are not.
Sigils are optional, and impose the following type constraints:
$: anything under Defined that isn't one of the above
No sigil means no type constraint.
Following the sigil or prefixing the attribute name with
! makes the attribute 'private'; that is, the generated accessor will start with
If your class has a method named
lazy_build => 1 is added to the attribute definition.
All attributes are declared
is => 'rw'.
There is no way to specify many options, like default, builder, handles, etc.
These are all internals that you probably don't care about. They'll be documented when they're stable.
Hans Dieter Pearcey <email@example.com>
This software is copyright (c) 2009 by Hans Dieter Pearcey. This is free software; you can redistribute it and/or modify it under the same terms as perl itself.