For more documentation on type constraints, see L<Mouse::Util::TypeConstraints>.
=item C<< does => RoleName >>
This will accept the name of a role which the value stored in this attribute
is expected to have consumed.
=item C<< coerce => Bool >>
This will attempt to use coercion with the supplied type constraint to change
the value passed into any accessors or constructors. You B<must> have supplied
a type constraint in order for this to work. See L<Moose::Cookbook::Basics::Recipe5>
for an example.
=item C<< required => Bool >>
Whether this attribute is required to have a value. If the attribute is lazy or
has a builder, then providing a value for the attribute in the constructor is
optional.
=item C<< init_arg => Str | Undef >>
Allows you to use a different key name in the constructor. If undef, the
attribute can't be passed to the constructor.
=item C<< default => Value | CodeRef >>
Sets the default value of the attribute. If the default is a coderef, it will
be invoked to get the default value. Due to quirks of Perl, any bare reference
is forbidden, you must wrap the reference in a coderef. Otherwise, all
instances will share the same reference.
=item C<< lazy => Bool >>
If specified, the default is calculated on demand instead of in the
constructor.
=item C<< predicate => Str >>
Lets you specify a method name for installing a predicate method, which checks
that the attribute has a value. It will not invoke a lazy default or builder
method.
=item C<< clearer => Str >>
Lets you specify a method name for installing a clearer method, which clears
the attribute's value from the instance. On the next read, lazy or builder will
be invoked.
=item C<< handles => HashRef|ArrayRef|Regexp >>
Lets you specify methods to delegate to the attribute. ArrayRef forwards the
given method names to method calls on the attribute. HashRef maps local method
names to remote method names called on the attribute. Other forms of
L</handles>, such as RoleName and CodeRef, are not yet supported.
=item C<< weak_ref => Bool >>
Lets you automatically weaken any reference stored in the attribute.
Use of this feature requires L<Scalar::Util>!
=item C<< trigger => CodeRef >>
Any time the attribute's value is set (either through the accessor or the constructor), the trigger is called on it. The trigger receives as arguments the instance, the new value, and the attribute instance.
=item C<< builder => Str >>
Defines a method name to be called to provide the default value of the
attribute. C<< builder => 'build_foo' >> is mostly equivalent to
C<< default => sub { $_[0]->build_foo } >>.
=item C<< auto_deref => Bool >>
Allows you to automatically dereference ArrayRef and HashRef attributes in list
context. In scalar context, the reference is returned (NOT the list length or
bucket status). You must specify an appropriate type constraint to use
auto_deref.
=item C<< lazy_build => Bool >>
Automatically define the following options:
has $attr => (
# ...
lazy => 1
builder => "_build_$attr",
clearer => "clear_$attr",
predicate => "has_$attr",
);
=back
=head2 C<< confess(message) -> BOOM >>
L<Carp/confess> for your convenience.
=head2 C<< blessed(value) -> ClassName | undef >>
L<Scalar::Util/blessed> for your convenience.
=head1 MISC
=head2 import
Importing Mouse will default your class' superclass list to L<Mouse::Object>.
You may use L</extends> to replace the superclass list.
=head2 unimport
Please unimport Mouse (C<no Mouse>) so that if someone calls one of the
keywords (such as L</extends>) it will break loudly instead breaking subtly.
=head1 SOURCE CODE ACCESS
We have a public git repository:
git clone git://git.moose.perl.org/Mouse.git
=head1 DEPENDENCIES
Perl 5.6.2 or later.
=head1 SEE ALSO
L<Mouse::Spec>
L<Moose>
L<Moose::Manual>
L<Moose::Cookbook>
L<Class::MOP>
=head1 AUTHORS
Shawn M Moore E<lt>sartak at gmail.comE<gt>
Yuval Kogman E<lt>nothingmuch at woobling.orgE<gt>
tokuhirom
Yappo
wu-lee
Goro Fuji (gfx) E<lt>gfuji at cpan.orgE<gt>
with plenty of code borrowed from L<Class::MOP> and L<Moose>
=head1 BUGS
All complex software has bugs lurking in it, and this module is no exception.
Please report any bugs to C<bug-mouse at rt.cpan.org>, or through the web
interface at L<http://rt.cpan.org/Public/Dist/Display.html?Name=Mouse>
=head1 COPYRIGHT AND LICENSE
Copyright (c) 2008-2010 Infinity Interactive, Inc.
http://www.iinteractive.com/
This program is free software; you can redistribute it and/or modify it