1 package Moose::Autobox::Hash;
2 use Moose::Role 'with';
6 with 'Moose::Autobox::Ref',
7 'Moose::Autobox::Indexed';
10 my ($hash, $key) = @_;
11 CORE::delete $hash->{$key};
14 # ::Indexed implementation
17 my ($hash, $index) = @_;
22 my ($hash, $index, $value) = @_;
23 $hash->{$index} = $value;
27 my ($hash, $key) = @_;
28 CORE::exists $hash->{$key};
33 [ CORE::keys %$hash ];
38 [ CORE::values %$hash ];
43 [ CORE::map { [ $_, $hash->{$_} ] } CORE::keys %$hash ];
54 Moose::Autobox::Hash - the Hash role
61 print { one => 1, two => 2 }->keys->join(', '); # prints 'one, two'
65 This is a role to describes a Hash value.
77 =head2 Moose::Autobox::Indexed implementation
97 All complex software has bugs lurking in it, and this module is no
98 exception. If you find a bug please either email me, or add the bug
103 Stevan Little E<lt>stevan@iinteractive.comE<gt>
105 =head1 COPYRIGHT AND LICENSE
107 Copyright 2006 by Infinity Interactive, Inc.
109 L<http://www.iinteractive.com>
111 This library is free software; you can redistribute it and/or modify
112 it under the same terms as Perl itself.