bump version to 1.25
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Array / delete.pm
CommitLineData
a7821be5 1package Moose::Meta::Method::Accessor::Native::Array::delete;
2
3use strict;
4use warnings;
5
0c3879e8 6our $VERSION = '1.25';
a7821be5 7$VERSION = eval $VERSION;
8our $AUTHORITY = 'cpan:STEVAN';
9
8b9641b8 10use Moose::Role;
11
12with 'Moose::Meta::Method::Accessor::Native::Array::Writer' => {
13 -excludes => [
14 qw(
15 _minimum_arguments
16 _maximum_arguments
17 _inline_check_arguments
18 _inline_optimized_set_new_value
7f5ec80d 19 _return_value
8b9641b8 20 )
21 ],
22};
a7821be5 23
24sub _minimum_arguments { 1 }
25
26sub _maximum_arguments { 1 }
27
28sub _inline_check_arguments {
29 my $self = shift;
30
31 return $self->_inline_check_var_is_valid_index('$_[0]');
32}
33
34sub _adds_members { 0 }
35
36sub _potential_value {
37 my ( $self, $slot_access ) = @_;
38
39 return
1d06edbf 40 "( do { my \@potential = \@{ ($slot_access) }; \@return = splice \@potential, \$_[0], 1; \\\@potential } )";
e32b7489 41}
42
43sub _inline_optimized_set_new_value {
44 my ( $self, $inv, $new, $slot_access ) = @_;
45
1d06edbf 46 return "\@return = splice \@{ ($slot_access) }, \$_[0], 1";
7f5ec80d 47}
48
49sub _return_value {
50 my ( $self, $slot_access ) = @_;
51
52 return 'return $return[0];';
a7821be5 53}
54
8b9641b8 55no Moose::Role;
56
a7821be5 571;