X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute%2FNative%2FTrait%2FHash.pm;h=7c50c72ec762cf831ef1274608e58dcdc598fc45;hb=3eb89f709f04907580b508f821d6be2316fcb65f;hp=df9d997b46547c09ffc99c2fd8d8896144fbc12c;hpb=9039e8ec60c872fa009efedd3b7b311128d1fc4b;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm index df9d997..7c50c72 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm @@ -2,7 +2,7 @@ package Moose::Meta::Attribute::Native::Trait::Hash; use Moose::Role; -our $VERSION = '0.89_01'; +our $VERSION = '1.01'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -29,7 +29,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Native::Trait::Hash +Moose::Meta::Attribute::Native::Trait::Hash - Helper trait for HashRef attributes =head1 SYNOPSIS @@ -44,7 +44,7 @@ Moose::Meta::Attribute::Native::Trait::Hash handles => { set_option => 'set', get_option => 'get', - has_no_options => 'empty', + has_no_options => 'is_empty', num_options => 'count', delete_option => 'delete', pairs => 'kv', @@ -63,17 +63,20 @@ L. =over 4 -=item B +=item B -Returns an element of the hash by its key. +Returns values from the hash. -=item B +In list context return a list of values in the hash for the given keys. +In scalar context returns the value for the last key specified. -Sets the element in the hash at the given key to the given value. +=item B $value, $key2 =E $value2...)> -=item B +Sets the elements in the hash to the given values. -Removes the element with the given key. +=item B + +Removes the elements with the given keys. =item B @@ -109,9 +112,10 @@ Resets the hash to an empty value, like C<%hash = ()>. =item B -Returns the number of elements in the hash. +Returns the number of elements in the hash. Also useful for not empty: +C<< has_options => 'count' >>. -=item B +=item B If the hash is populated, returns false. Otherwise, returns true. @@ -136,9 +140,7 @@ arguments, sets the value of the specified key. =head1 BUGS -All complex software has bugs lurking in it, and this module is no -exception. If you find a bug please either email me, or add the bug -to cpan-RT. +See L for details on reporting bugs. =head1 AUTHOR