1 package Moose::Meta::Method::Accessor::Native::Array::sort;
9 $VERSION = eval $VERSION;
10 our $AUTHORITY = 'cpan:STEVAN';
14 with 'Moose::Meta::Method::Accessor::Native::Reader' => {
18 _inline_check_arguments
23 sub _maximum_arguments { 1 }
25 sub _inline_check_arguments {
28 return $self->_inline_throw_error(
29 q{'The argument passed to sort must be a code reference'})
30 . q{ if @_ && ! Params::Util::_CODELIKE( $_[0] );};
35 my $slot_access = shift;
38 "\$_[0] ? sort { \$_[0]->( \$a, \$b ) } \@{ ($slot_access) } : sort \@{ ($slot_access) }";