Add documents for attributes
gfx [Mon, 7 Dec 2009 05:11:35 +0000 (14:11 +0900)]
lib/Mouse.pm

index aaa5142..c15aa15 100644 (file)
@@ -270,10 +270,16 @@ this class. Options:
 
 =item C<< is => ro|rw|bare >>
 
-If specified, inlines a read-only/read-write accessor with the same name as
+The I<is> option accepts either I<rw> (for read/write), I<ro> (for read
+only) or I<bare> (for nothing). These will create either a read/write accessor
+or a read-only accessor respectively, using the same name as the C<$name> of
 the attribute.
 
-=item C<< isa => TypeConstraint >>
+If you need more control over how your accessors are named, you can
+use the C<reader>, C<writer> and C<accessor> options, however if you
+use those, you won't need the I<is> option.
+
+=item C<< isa => TypeName | ClassName >>
 
 Provides type checking in the constructor and accessor. The following types are
 supported. Any unknown type is taken to be a class check
@@ -285,6 +291,17 @@ supported. Any unknown type is taken to be a class check
 
 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 >>
 
@@ -321,12 +338,12 @@ 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 >>
+=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 regular expression and coderef, are not yet supported.
+L</handles>, such as RoleName and CodeRef, are not yet supported.
 
 =item C<< weak_ref => Bool >>