1 package Mouse::Meta::Method::Delegation;
2 use Mouse::Util qw(:meta); # enables strict and warnings
5 sub _generate_delegation{
6 my (undef, $attribute, $handle_name, $method_to_call) = @_;
8 my $reader = $attribute->get_read_method_ref();
11 my $proxy = $instance->$reader();
13 my $error = !defined($proxy) ? ' is not defined'
14 : ref($proxy) && !Scalar::Util::blessed($proxy) ? qq{ is not an object (got '$proxy')}
17 $instance->meta->throw_error(
18 "Cannot delegate $handle_name to $method_to_call because "
24 $proxy->$method_to_call(@_);
34 Mouse::Meta::Method::Delegation - A Mouse method generator for delegation methods
38 This document describes Mouse version 0.50
42 L<Moose::Meta::Method::Delegation>