From: Chris Prather Date: Sun, 9 Aug 2009 20:47:16 +0000 (-0400) Subject: update Hash documentation X-Git-Tag: 0.89_02~75 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=96fd0bec0fb08166f830f5b06fb07cd7f41e57bb;p=gitmo%2FMoose.git update Hash documentation --- diff --git a/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm index d8282d8..ed6af93 100644 --- a/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm @@ -188,10 +188,8 @@ Moose::Meta::Attribute::Native::MethodProvider::Hash =head1 DESCRIPTION This is a role which provides the method generators for -L. - -This role is composed from the -L role. +L. Please check there for +documentation on what methods are provided. =head1 METHODS @@ -201,65 +199,6 @@ L role. =back -=head1 PROVIDED METHODS - -=over 4 - -=item B - -Returns the number of elements in the list. - -=item B - -If the list is populated, returns true. Otherwise, returns false. - -=item B - -Returns true if the given key is present in the hash - -=item B - -Returns true if the value of a given key is defined - -=item B - -Returns an element of the hash by its key. - -=item B - -Returns the list of keys in the hash. - -=item B - -Returns the list of values in the hash. - -=item B - -Returns the key, value pairs in the hash as array references - -=item B - -Returns the key, value pairs in the hash as a flattened list - -=item B - -Removes the element with the given key - -=item B - -Unsets the hash entirely. - -=item B - -Sets the element in the hash at the given key to the given value. - -=item B - -If passed one argument, returns the value of the requested key. If passed two -arguments, sets the value of the requested key. - -=back - =head1 BUGS All complex software has bugs lurking in it, and this module is no diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm index b2c6bd2..48576fb 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm @@ -38,7 +38,7 @@ Moose::Meta::Attribute::Native::Trait::Hash use Moose::AttributeHelpers; has 'options' => ( - metaclass => 'Hash', + traits => ['Hash'], is => 'ro', isa => 'HashRef[Str]', default => sub { {} }, @@ -54,8 +54,69 @@ Moose::Meta::Attribute::Native::Trait::Hash =head1 DESCRIPTION This module provides a Hash attribute which provides a number of -hash-like operations. See L -for more details. +hash-like operations. + +=head1 PROVIDED METHODS + +These methods are implemented in +L. + +=over 4 + +=item B + +Returns the number of elements in the list. + +=item B + +If the list is populated, returns true. Otherwise, returns false. + +=item B + +Returns true if the given key is present in the hash + +=item B + +Returns true if the value of a given key is defined + +=item B + +Returns an element of the hash by its key. + +=item B + +Returns the list of keys in the hash. + +=item B + +Returns the list of values in the hash. + +=item B + +Returns the key, value pairs in the hash as array references + +=item B + +Returns the key, value pairs in the hash as a flattened list + +=item B + +Removes the element with the given key + +=item B + +Unsets the hash entirely. + +=item B + +Sets the element in the hash at the given key to the given value. + +=item B + +If passed one argument, returns the value of the requested key. If passed two +arguments, sets the value of the requested key. + +=back =head1 METHODS