All of the non-mutating array helpers are now inlined.
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Array / reduce.pm
CommitLineData
910684ee 1package Moose::Meta::Method::Accessor::Native::Array::reduce;
2
3use strict;
4use warnings;
5
6use List::Util ();
7
8our $VERSION = '1.13';
9$VERSION = eval $VERSION;
10our $AUTHORITY = 'cpan:STEVAN';
11
12use base 'Moose::Meta::Method::Accessor::Native::Array::Reader';
13
14sub _inline_process_arguments {
15 return 'my $func = shift;';
16}
17
18sub _inline_check_arguments {
19 return
20 q{die 'Must provide a code reference as an argument' unless ( ref $func || q{} ) eq 'CODE';};
21}
22
23sub _return_value {
24 my $self = shift;
25 my $slot_access = shift;
26
27 return "List::Util::reduce { \$func->( \$a, \$b ) } \@{ ${slot_access} }";
28}
29
301;