All of the non-mutating array helpers are now inlined.
[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
10use base 'Moose::Meta::Method::Accessor::Native::Array::Reader';
11
12sub _inline_process_arguments {
13 return 'my $idx = shift;';
14}
15
16sub _inline_check_arguments {
17 return
18 q{die 'Must provide a valid index number as an argument' unless defined $idx && $idx =~ /^-?\d+$/;};
19}
20
21sub _return_value {
22 my $self = shift;
23 my $slot_access = shift;
24
25 return "${slot_access}->[\$idx]";
26}
27
281;