1 package Mouse::Meta::Method::Delegation;
2 use Mouse::Util; # enables strict and warnings
3 use Scalar::Util qw(blessed);
5 sub _generate_delegation{
6 my (undef, $attribute, $metaclass, $reader, $handle_name, $method_to_call) = @_;
10 my $proxy = $instance->$reader();
12 my $error = !defined($proxy) ? ' is not defined'
13 : ref($proxy) && !blessed($proxy) ? qq{ is not an object (got '$proxy')}
16 $instance->meta->throw_error(
17 "Cannot delegate $handle_name to $method_to_call because "
23 $proxy->$method_to_call(@_);
33 Mouse::Meta::Method::Delegation - A Mouse method generator for delegation methods
37 This document describes Mouse version 0.40_03
41 L<Moose::Meta::Method::Delegation>