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
60 print { one => 1, two => 2 }->keys->join(', '); # prints 'one, two'
64 This is a role to describes a Hash value.
74 =head2 Indexed implementation
100 All complex software has bugs lurking in it, and this module is no
101 exception. If you find a bug please either email me, or add the bug
106 Stevan Little E<lt>stevan@iinteractive.comE<gt>
108 =head1 COPYRIGHT AND LICENSE
110 Copyright 2006 by Infinity Interactive, Inc.
112 L<http://www.iinteractive.com>
114 This library is free software; you can redistribute it and/or modify
115 it under the same terms as Perl itself.