stop using excludes within moose, since it's no longer necessary
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Array / unshift.pm
CommitLineData
a7821be5 1package Moose::Meta::Method::Accessor::Native::Array::unshift;
2
3use strict;
4use warnings;
5
8b9641b8 6use Moose::Role;
7
00bbc132 8with 'Moose::Meta::Method::Accessor::Native::Array::Writer';
a7821be5 9
10sub _adds_members { 1 }
11
12sub _potential_value {
53a4677c 13 my $self = shift;
14 my ($slot_access) = @_;
a7821be5 15
53a4677c 16 return '[ @_, @{ (' . $slot_access . ') } ]';
e32b7489 17}
18
a486d5ad 19sub _inline_optimized_set_new_value {
53a4677c 20 my $self = shift;
21 my ($inv, $new, $slot_access) = @_;
e32b7489 22
a486d5ad 23 return 'unshift @{ (' . $slot_access . ') }, @_;';
a7821be5 24}
25
7f5ec80d 26sub _return_value {
53a4677c 27 my $self = shift;
28 my ($slot_access) = @_;
7f5ec80d 29
53a4677c 30 return 'scalar @{ (' . $slot_access . ') }';
7f5ec80d 31}
32
8b9641b8 33no Moose::Role;
34
a7821be5 351;