bump version to 1.25
[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 ();
88e88a7b 7use Params::Util ();
910684ee 8
0c3879e8 9our $VERSION = '1.25';
910684ee 10$VERSION = eval $VERSION;
11our $AUTHORITY = 'cpan:STEVAN';
12
8b9641b8 13use Moose::Role;
14
15with 'Moose::Meta::Method::Accessor::Native::Reader' => {
16 -excludes => [
17 qw(
18 _minimum_arguments
19 _maximum_arguments
20 _inline_check_arguments
21 )
22 ]
23};
910684ee 24
a7821be5 25sub _minimum_arguments { 1 }
26
27sub _maximum_arguments { 1 }
910684ee 28
29sub _inline_check_arguments {
e3181911 30 my $self = shift;
31
32 return $self->_inline_throw_error(
33 q{'The argument passed to reduce must be a code reference'})
88e88a7b 34 . q{ unless Params::Util::_CODELIKE( $_[0] );};
910684ee 35}
36
37sub _return_value {
38 my $self = shift;
39 my $slot_access = shift;
40
1d06edbf 41 return "List::Util::reduce { \$_[0]->( \$a, \$b ) } \@{ ($slot_access) }";
910684ee 42}
43
8b9641b8 44no Moose::Role;
45
910684ee 461;