From: Dave Rolsky Date: Thu, 14 Oct 2010 18:43:35 +0000 (-0500) Subject: some more small doc improvements for native traits X-Git-Tag: 1.16~45 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7795e4de979ee4b2b923ec04109ec1188524881f;p=gitmo%2FMoose.git some more small doc improvements for native traits --- diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Array.pm b/lib/Moose/Meta/Attribute/Native/Trait/Array.pm index e05d2e0..182eef2 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Array.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Array.pm @@ -77,8 +77,12 @@ Moose::Meta::Attribute::Native::Trait::Array - Helper trait for array delegation =head1 DESCRIPTION -This module provides an Array attribute which provides a number of -array operations. +This trait provides native delegation methods for array references. + +=head1 DEFAULT TYPE + +If you don't provide an C value for your attribute, it will default to +C. =head1 PROVIDED METHODS diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm b/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm index b636230..fa6bea6 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm @@ -51,8 +51,13 @@ Moose::Meta::Attribute::Native::Trait::Bool - Helper trait for Bool attributes =head1 DESCRIPTION -This provides a simple boolean attribute, which supports most of the -basic math operations. +This trait provides native delegation methods for boolean values. A boolean is +a scalar which can be C<1>, C<0>, C<"">, or C. + +=head1 DEFAULT TYPE + +If you don't provide an C value for your attribute, it will default to +C. =head1 PROVIDED METHODS diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Code.pm b/lib/Moose/Meta/Attribute/Native/Trait/Code.pm index b1333cf..360c866 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Code.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Code.pm @@ -44,7 +44,12 @@ Moose::Meta::Attribute::Native::Trait::Code - Helper trait for Code attributes =head1 DESCRIPTION -This provides operations on coderef attributes. +This trait provides native delegation methods for code references. + +=head1 DEFAULT TYPE + +If you don't provide an C value for your attribute, it will default to +C. =head1 PROVIDED METHODS diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm b/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm index 14334d9..faaf770 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm @@ -57,9 +57,14 @@ Moose::Meta::Attribute::Native::Trait::Counter - Helper trait for counters =head1 DESCRIPTION -This module provides a simple counter attribute, which can be -incremented and decremented by arbitrary amounts. The default -amount of change is one. +This trait provides native delegation methods for counters. A counter can be +any sort of number (integer or not). The delegation methods allow you to +increment, decrement, or reset the value. + +=head1 DEFAULT TYPE + +If you don't provide an C value for your attribute, it will default to +C. =head1 PROVIDED METHODS diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm index 6cdf98e..b1b68c9 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm @@ -58,8 +58,7 @@ Moose::Meta::Attribute::Native::Trait::Hash - Helper trait for HashRef attribute =head1 DESCRIPTION -This module provides a Hash attribute which provides a number of -hash-like operations. +This trait provides native delegation methods for array references. =head1 PROVIDED METHODS diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Number.pm b/lib/Moose/Meta/Attribute/Native/Trait/Number.pm index 361fb81..74b7714 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Number.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Number.pm @@ -54,45 +54,45 @@ Moose::Meta::Attribute::Native::Trait::Number - Helper trait for Num attributes =head1 DESCRIPTION -This provides a simple numeric attribute, which supports most of the -basic math operations. +This trait provides native delegation methods for numbers. All of the +operations correspond to arithmetic operations like addition or +multiplication. + +=head1 DEFAULT TYPE + +If you don't provide an C value for your attribute, it will default to +C. =head1 PROVIDED METHODS -It is important to note that all those methods do in place modification of the -value stored in the attribute. These methods are implemented within this -package. +All of these methods modify the attribute's value in place. All methods return +the new value. =over 4 =item * B -Adds the current value of the attribute to C<$value>. Returns the new value. +Adds the current value of the attribute to C<$value>. =item * B -Subtracts C<$value> from the current value of the attribute. Returns the new -value. +Subtracts C<$value> from the current value of the attribute. =item * B -Multiplies the current value of the attribute by C<$value>. Returns the new -value. +Multiplies the current value of the attribute by C<$value>. =item * B -Divides the current value of the attribute by C<$value>. Returns the new -value. +Divides the current value of the attribute by C<$value>. =item * B -Returns the current value of the attribute modulo C<$value>. Returns the new -value. +Returns the current value of the attribute modulo C<$value>. =item * B -Sets the current value of the attribute to its absolute value. Returns the new -value. +Sets the current value of the attribute to its absolute value. =back diff --git a/lib/Moose/Meta/Attribute/Native/Trait/String.pm b/lib/Moose/Meta/Attribute/Native/Trait/String.pm index 4d690a8..02b5be3 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/String.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/String.pm @@ -55,18 +55,12 @@ Moose::Meta::Attribute::Native::Trait::String - Helper trait for Str attributes =head1 DESCRIPTION -This module provides a simple string attribute, to which mutating string -operations can be applied more easily (no need to make an lvalue attribute -metaclass or use temporary variables). Additional methods are provided for -completion. - -If your attribute definition does not include any of I, I, -I or I but does use the C metaclass, -then this module applies defaults as in the L -above. This allows for a very basic string definition: - - has 'foo' => (traits => ['String']); - $obj->append_foo; +This trait provides native delegation methods for strings. + +=head1 DEFAULT TYPE + +If you don't provide an C value for your attribute, it will default to +C. =head1 PROVIDED METHODS