Add inlining methods for Number native trait
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Array / get.pm
CommitLineData
910684ee 1package Moose::Meta::Method::Accessor::Native::Array::get;
2
3use strict;
4use warnings;
5
6our $VERSION = '1.13';
7$VERSION = eval $VERSION;
8our $AUTHORITY = 'cpan:STEVAN';
9
126a13c8 10use base qw(
11 Moose::Meta::Method::Accessor::Native::Array
12 Moose::Meta::Method::Accessor::Native::Reader
13);
910684ee 14
a7821be5 15sub _minimum_arguments { 1 }
16
17sub _maximum_arguments { 1 }
910684ee 18
19sub _inline_check_arguments {
a7821be5 20 my $self = shift;
21
22 return $self->_inline_check_var_is_valid_index('$_[0]');
910684ee 23}
24
25sub _return_value {
26 my $self = shift;
27 my $slot_access = shift;
28
a7821be5 29 return "${slot_access}->[ \$_[0] ]";
910684ee 30}
31
321;