Got inlining for hashes working.
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Hash / get.pm
CommitLineData
44babf1f 1package Moose::Meta::Method::Accessor::Native::Hash::get;
2
3use strict;
4use warnings;
5
6use Scalar::Util qw( looks_like_number );
7
8our $VERSION = '1.13';
9$VERSION = eval $VERSION;
10our $AUTHORITY = 'cpan:STEVAN';
11
12use base 'Moose::Meta::Method::Accessor::Native::Reader';
13
14Class::MOP::MiniTrait::apply( __PACKAGE__,
15 'Moose::Meta::Method::Accessor::Native::Hash'
16);
17
18sub _minimum_arguments { 1 }
19
20sub _maximum_arguments { undef }
21
22sub _inline_check_arguments {
23 my $self = shift;
24
25 return
26 'for (@_) {' . "\n"
27 . $self->_inline_check_var_is_valid_key('$_') . "\n" . '}';
28}
29
30sub _return_value {
31 my $self = shift;
32 my $slot_access = shift;
33
34 return "\@_ > 1 ? \@{ $slot_access }{\@_} : ${slot_access}->{ \$_[0] }";
35}
36
37
381;