X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute%2FNative%2FMethodProvider%2FHash.pm;h=7943d674f439e96c29648ef4407fbd0d81595ddb;hb=d4048ef33f6cad8a3453766505ee0c67690796f6;hp=d8282d8ae173e1bf0031fefa79198166ee26a3ad;hpb=c466e58f62cf93887b29809993bd7830c8350079;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm index d8282d8..7943d67 100644 --- a/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm @@ -1,7 +1,7 @@ package Moose::Meta::Attribute::Native::MethodProvider::Hash; use Moose::Role; -our $VERSION = '0.87'; +our $VERSION = '0.93'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -59,9 +59,9 @@ sub count : method { return sub { scalar CORE::keys %{ $reader->( $_[0] ) } }; } -sub empty : method { +sub is_empty : method { my ( $attr, $reader, $writer ) = @_; - return sub { scalar CORE::keys %{ $reader->( $_[0] ) } ? 1 : 0 }; + return sub { scalar CORE::keys %{ $reader->( $_[0] ) } ? 0 : 1 }; } @@ -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,70 +199,9 @@ 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 -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