2 package Moose::Meta::Attribute::Native::Trait::Hash;
6 $VERSION = eval $VERSION;
7 our $AUTHORITY = 'cpan:STEVAN';
9 use Moose::Meta::Attribute::Native::MethodProvider::Hash;
11 with 'Moose::Meta::Attribute::Native::Trait';
13 has 'method_provider' => (
16 predicate => 'has_method_provider',
17 default => 'Moose::Meta::Attribute::Native::MethodProvider::Hash'
20 sub _helper_type { 'HashRef' }
32 Moose::Meta::Attribute::Native::Trait::Hash
42 isa => 'HashRef[Str]',
43 default => sub { {} },
47 has_options => 'empty',
48 num_options => 'count',
49 delete_option => 'delete',
55 This module provides a Hash attribute which provides a number of
58 =head1 PROVIDED METHODS
60 These methods are implemented in
61 L<Moose::Meta::Attribute::Native::MethodProvider::Hash>.
67 Returns the number of elements in the list.
71 If the list is populated, returns true. Otherwise, returns false.
75 Returns true if the given key is present in the hash
79 Returns true if the value of a given key is defined
83 Returns an element of the hash by its key.
87 Returns the list of keys in the hash.
91 Returns the list of values in the hash.
95 Returns the key, value pairs in the hash as array references
99 Returns the key, value pairs in the hash as a flattened list
103 Removes the element with the given key
107 Unsets the hash entirely.
111 Sets the element in the hash at the given key to the given value.
115 If passed one argument, returns the value of the requested key. If passed two
116 arguments, sets the value of the requested key.
126 =item B<method_provider>
128 =item B<has_method_provider>
134 All complex software has bugs lurking in it, and this module is no
135 exception. If you find a bug please either email me, or add the bug
140 Stevan Little E<lt>stevan@iinteractive.comE<gt>
142 =head1 COPYRIGHT AND LICENSE
144 Copyright 2007-2009 by Infinity Interactive, Inc.
146 L<http://www.iinteractive.com>
148 This library is free software; you can redistribute it and/or modify
149 it under the same terms as Perl itself.