Beginning of dzilization
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Array / push.pm
CommitLineData
f7fd22b6 1package Moose::Meta::Method::Accessor::Native::Array::push;
2
3use strict;
4use warnings;
5
f7fd22b6 6our $AUTHORITY = 'cpan:STEVAN';
7
8b9641b8 8use Moose::Role;
9
7f5ec80d 10with 'Moose::Meta::Method::Accessor::Native::Array::Writer' => {
11 -excludes => [
12 qw(
a486d5ad 13 _inline_optimized_set_new_value
7f5ec80d 14 _return_value
15 )
16 ]
17};
f7fd22b6 18
a7821be5 19sub _adds_members { 1 }
f7fd22b6 20
a7821be5 21sub _potential_value {
53a4677c 22 my $self = shift;
23 my ($slot_access) = @_;
f7fd22b6 24
53a4677c 25 return '[ @{ (' . $slot_access . ') }, @_ ]';
e32b7489 26}
27
a486d5ad 28sub _inline_optimized_set_new_value {
53a4677c 29 my $self = shift;
30 my ($inv, $new, $slot_access) = @_;
e32b7489 31
a486d5ad 32 return 'push @{ (' . $slot_access . ') }, @_;';
f7fd22b6 33}
34
7f5ec80d 35sub _return_value {
53a4677c 36 my $self = shift;
37 my ($slot_access) = @_;
7f5ec80d 38
53a4677c 39 return 'scalar @{ (' . $slot_access . ') }';
7f5ec80d 40}
41
8b9641b8 42no Moose::Role;
43
f7fd22b6 441;