From: Chris Weyl Date: Thu, 22 Sep 2011 18:29:33 +0000 (-0700) Subject: Document new Hash native trait accessors X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fattic%2Fmore-native-trait-accessors;p=gitmo%2FMoose.git Document new Hash native trait accessors --- diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm index 34b2998..b2d049f 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm @@ -143,6 +143,38 @@ is a reference to a new hash with the same keys and values. It is I because any values that were references in the original will be the I references in the clone. +=item B + +=item B + +This method transforms every element in the array of keys or values of the hash +and returns an array, just like Perl's core C function. This method +requires a subroutine which implements the transformation. + +This method requires a single argument. + +=item B + +=item B + +This method returns every element in the array of keys or values matching a +given criteria, just like Perl's core C function. This method requires a +subroutine which implements the matching logic. + +This method requires a single argument. + +=item B + +=item B + +Returns the elements of the array of keys or values in sorted order. + +You can provide an optional subroutine reference to sort with (as you can with +Perl's core C function). However, instead of using C<$a> and C<$b> in +this subroutine, you will need to use C<$_[0]> and C<$_[1]>. + +This method accepts a single argument. + =back Note that C is deliberately omitted, due to its stateful interaction