);
In this case, the metaclass C<Hash> really refers to
-L<Moose::Meta::Attribute::Trait::Native::Hash>.
+L<Moose::Meta::Attribute::Native::Trait::Hash>. Moose also provides
+native traits for L<Number|Moose::Meta::Attribute::Native::Trait::Number>,
+L<Counter|Moose::Meta::Attribute::Native::Trait::Counter>,
+L<String|Moose::Meta::Attribute::Native::Trait::String>,
+L<Bool|Moose::Meta::Attribute::Native::Trait::Bool>, and
+L<Array|Moose::Meta::Attribute::Native::Trait::Array>.
You can also apply one or more traits to an attribute:
default => sub { [] },
handles => {
all_options => 'elements',
+ add_option => 'push',
map_options => 'map',
filter_options => 'grep',
find_option => 'first',
get_option => 'get',
join_options => 'join',
count_options => 'count',
+ has_options => 'count',
has_no_options => 'is_empty',
sorted_options => 'sort',
},
=item B<pop>
-=item B<push($value)>
+=item B<push($value1, $value2, value3 ...)>
=item B<shift>
-=item B<unshift($value)>
+=item B<unshift($value1, $value2, value3 ...)>
=item B<splice($offset, $length, @values)>
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.
-=item B<set($key => $value, $key2 => $value2 ...)>
+=item B<set($key =E<gt> $value, $key2 =E<gt> $value2 ...)>
Sets the elements in the hash to the given values.
=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<is_empty>