package MooseX::AttributeHelpers::MethodProvider::ImmutableHash;
use Moose::Role;
-our $VERSION = '0.03';
+our $VERSION = '0.12_01';
+$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
sub exists : method {
sub get : method {
my ($attr, $reader, $writer) = @_;
- return sub { $reader->($_[0])->{$_[1]} };
+ return sub {
+ if ( @_ == 2 ) {
+ $reader->($_[0])->{$_[1]}
+ } else {
+ my ( $self, @keys ) = @_;
+ @{ $reader->($self) }{@keys}
+ }
+ };
}
sub keys : method {
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>