Version 1.05
[gitmo/Moose.git] / lib / Moose / Meta / Attribute / Native / Trait / Hash.pm
index df9d997..d524366 100644 (file)
@@ -2,7 +2,7 @@
 package Moose::Meta::Attribute::Native::Trait::Hash;
 use Moose::Role;
 
-our $VERSION   = '0.89_01';
+our $VERSION   = '1.05';
 $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<Moose::Meta::Attribute::Native::MethodProvider::Hash>.
 
 =over 4
 
-=item B<get($key)>
+=item B<get($key, $key2, $key3...)>
 
-Returns an element of the hash by its key.
+Returns values from the hash.
 
-=item B<set($key)>
+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<set($key =E<gt> $value, $key2 =E<gt> $value2...)>
 
-=item B<delete($key)>
+Sets the elements in the hash to the given values.
 
-Removes the element with the given key.
+=item B<delete($key, $key2, $key3...)>
+
+Removes the elements with the given keys.
 
 =item B<keys>
 
@@ -109,9 +112,10 @@ Resets the hash to an empty value, like C<%hash = ()>.
 
 =item B<count>
 
-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<empty>
+=item B<is_empty>
 
 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<Moose/BUGS> for details on reporting bugs.
 
 =head1 AUTHOR