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 {
29 'if (@_ && !Params::Util::_CODELIKE($_[0])) {',
30 $self->_inline_throw_error(
31 '"The argument passed to sort must be a code reference"',
39 my ($slot_access) = @_;
42 . '? sort { $_[0]->($a, $b) } @{ (' . $slot_access . ') } '
43 . ': sort @{ (' . $slot_access . ') }';