Remove all trailing whitespace
[gitmo/Moose.git] / lib / Moose / Meta / Attribute / Native / Trait / Hash.pm
index e879692..34b2998 100644 (file)
@@ -2,24 +2,6 @@
 package Moose::Meta::Attribute::Native::Trait::Hash;
 use Moose::Role;
 
-our $VERSION   = '1.16';
-$VERSION = eval $VERSION;
-our $AUTHORITY = 'cpan:STEVAN';
-
-use Moose::Meta::Method::Accessor::Native::Hash::accessor;
-use Moose::Meta::Method::Accessor::Native::Hash::clear;
-use Moose::Meta::Method::Accessor::Native::Hash::count;
-use Moose::Meta::Method::Accessor::Native::Hash::defined;
-use Moose::Meta::Method::Accessor::Native::Hash::delete;
-use Moose::Meta::Method::Accessor::Native::Hash::elements;
-use Moose::Meta::Method::Accessor::Native::Hash::exists;
-use Moose::Meta::Method::Accessor::Native::Hash::get;
-use Moose::Meta::Method::Accessor::Native::Hash::is_empty;
-use Moose::Meta::Method::Accessor::Native::Hash::keys;
-use Moose::Meta::Method::Accessor::Native::Hash::kv;
-use Moose::Meta::Method::Accessor::Native::Hash::set;
-use Moose::Meta::Method::Accessor::Native::Hash::values;
-
 with 'Moose::Meta::Attribute::Native::Trait';
 
 sub _helper_type { 'HashRef' }
@@ -28,14 +10,12 @@ no Moose::Role;
 
 1;
 
+# ABSTRACT: Helper trait for HashRef attributes
+
 __END__
 
 =pod
 
-=head1 NAME
-
-Moose::Meta::Attribute::Native::Trait::Hash - Helper trait for HashRef attributes
-
 =head1 SYNOPSIS
 
   package Stuff;
@@ -58,7 +38,7 @@ Moose::Meta::Attribute::Native::Trait::Hash - Helper trait for HashRef attribute
 
 =head1 DESCRIPTION
 
-This trait provides native delegation methods for array references.
+This trait provides native delegation methods for hash references.
 
 =head1 PROVIDED METHODS
 
@@ -116,7 +96,7 @@ This method does not accept any arguments.
 
 Returns the key/value pairs in the hash as an array of array references.
 
-  for my $pair ( $object->options->pairs ) {
+  for my $pair ( $object->options->kv ) {
       print "$pair->[0] = $pair->[1]\n";
   }
 
@@ -136,7 +116,7 @@ This method does not accept any arguments.
 
 =item B<count>
 
-Returns the number of elements in the hash. Also useful for not empty: 
+Returns the number of elements in the hash. Also useful for not empty:
 C<< has_options => 'count' >>.
 
 This method does not accept any arguments.
@@ -156,8 +136,18 @@ arguments, sets the value of the specified key.
 
 When called as a setter, this method returns the value that was set.
 
+=item B<shallow_clone>
+
+This method returns a shallow clone of the hash reference.  The return value
+is a reference to a new hash with the same keys and values.  It is I<shallow>
+because any values that were references in the original will be the I<same>
+references in the clone.
+
 =back
 
+Note that C<each> is deliberately omitted, due to its stateful interaction
+with the hash iterator. C<keys> or C<kv> are much safer.
+
 =head1 METHODS
 
 =over 4
@@ -170,17 +160,4 @@ When called as a setter, this method returns the value that was set.
 
 See L<Moose/BUGS> for details on reporting bugs.
 
-=head1 AUTHOR
-
-Stevan Little E<lt>stevan@iinteractive.comE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2007-2009 by Infinity Interactive, Inc.
-
-L<http://www.iinteractive.com>
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
 =cut