Remove another empty class in the native array inheritance hierarchy
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Array / map.pm
1 package Moose::Meta::Method::Accessor::Native::Array::map;
2
3 use strict;
4 use warnings;
5
6 our $VERSION = '1.13';
7 $VERSION = eval $VERSION;
8 our $AUTHORITY = 'cpan:STEVAN';
9
10 use base 'Moose::Meta::Method::Accessor::Native::Reader';
11
12 sub _minimum_arguments { 1 }
13
14 sub _maximum_arguments { 1 }
15
16 sub _inline_check_arguments {
17     my $self = shift;
18
19     return $self->_inline_throw_error(
20         q{'The argument passed to map must be a code reference'})
21         . q{if $_[0] && ( ref $_[0] || q{} ) ne 'CODE';};
22 }
23
24 sub _return_value {
25     my $self        = shift;
26     my $slot_access = shift;
27
28     return "map { \$_[0]->() } \@{ $slot_access }";
29 }
30
31 1;