my $delegator = $self->delegation_metaclass;
Mouse::Util::load_class($delegator);
- return $delegator->_generate_delegation($self, $handle,
- ref($method_to_call) eq 'ARRAY'
- ? @{$method_to_call}
- : $method_to_call);
+ return $delegator->_generate_delegation($self, $handle, $method_to_call);
}
sub throw_error{
use Scalar::Util;
sub _generate_delegation{
- my (undef, $attr, $handle_name, $method_to_call, @curried_args) = @_;
+ my (undef, $attr, $handle_name, $method_to_call) = @_;
+
+ my @curried_args;
+ if(ref($method_to_call) eq 'ARRAY'){
+ ($method_to_call, @curried_args) = @{$method_to_call};
+ }
my $reader = $attr->get_read_method_ref();