Commit | Line | Data |
---|---|---|
910684ee | 1 | package Moose::Meta::Method::Accessor::Native::Array::get; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
44babf1f | 6 | use Class::MOP::MiniTrait; |
7 | ||
245478d5 | 8 | our $VERSION = '1.19'; |
910684ee | 9 | $VERSION = eval $VERSION; |
10 | our $AUTHORITY = 'cpan:STEVAN'; | |
11 | ||
8b9641b8 | 12 | use Moose::Role; |
13 | ||
14 | with 'Moose::Meta::Method::Accessor::Native::Reader' => { | |
15 | -excludes => [ | |
16 | qw( | |
17 | _minimum_arguments | |
18 | _maximum_arguments | |
19 | _inline_check_arguments | |
20 | ) | |
21 | ], | |
22 | }, | |
23 | 'Moose::Meta::Method::Accessor::Native::Array'; | |
910684ee | 24 | |
a7821be5 | 25 | sub _minimum_arguments { 1 } |
26 | ||
27 | sub _maximum_arguments { 1 } | |
910684ee | 28 | |
29 | sub _inline_check_arguments { | |
a7821be5 | 30 | my $self = shift; |
31 | ||
32 | return $self->_inline_check_var_is_valid_index('$_[0]'); | |
910684ee | 33 | } |
34 | ||
35 | sub _return_value { | |
53a4677c | 36 | my $self = shift; |
37 | my ($slot_access) = @_; | |
910684ee | 38 | |
53a4677c | 39 | return $slot_access . '->[ $_[0] ]'; |
910684ee | 40 | } |
41 | ||
42 | 1; |