Moose::Micro - succinctly specify Moose attributes


Moose-Micro documentation  | view source Contained in the Moose-Micro distribution.

Index


NAME

Top

Moose::Micro - succinctly specify Moose attributes

VERSION

Top

version 0.002

SYNOPSIS

Top

  package MyClass;
  use Moose::Micro 'foo $bar @baz; %!quux';

DESCRIPTION

Top

Moose::Micro makes it easy to declare Moose attributes without a lot of typing.

SYNTAX

Top

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:

* @: ArrayRef
* %: HashRef
* $: 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 _, e.g.:

  !foo $!bar

If your class has a method named _build_$attribute, lazy_build => 1 is added to the attribute definition.

LIMITATIONS

Top

All attributes are declared is => 'rw'.

There is no way to specify many options, like default, builder, handles, etc.

METHODS

Top

These are all internals that you probably don't care about. They'll be documented when they're stable.

attribute_list

attribute_args

type_constraint_for

unimport

SEE ALSO

Top

Moose

AUTHOR

Top

  Hans Dieter Pearcey <hdp@cpan.org>

COPYRIGHT AND LICENSE

Top


Moose-Micro documentation  | view source Contained in the Moose-Micro distribution.