Venus::Role::Proxyable
Proxyable Role
Proxyable Role for Perl 5
method: build_proxy
package Example;
use Venus::Class;
with 'Venus::Role::Proxyable';
attr 'test';
sub build_proxy {
my ($self, $package, $method, @args) = @_;
return sub { [$self, $package, $method, @args] } if $method eq 'anything';
return undef;
}
package main;
my $example = Example->new(test => time);
# $example->anything(1..4);
This package provides a hook into method dispatch resoluton via a wrapper around the AUTOLOAD routine which processes calls to routines which don't exist.
The build_proxy method should return a code reference to fulfill the method dispatching request, or undef to result in a method not found error.
build_proxy(string $package, string $method, any @args) (coderef | undef)
{ since => '0.01', }
=example-1 build_proxy
package main;
my $example = Example->new(test => 123);
my $build_proxy = $example->build_proxy('Example', 'everything', 1..4);
# undef
t/Venus.t: present: authors t/Venus.t: present: license
11 POD Errors
The following errors were encountered while parsing the POD:
- Around line 14:
Unknown directive: =name
- Around line 22:
Unknown directive: =tagline
- Around line 30:
Unknown directive: =abstract
- Around line 38:
Unknown directive: =includes
- Around line 46:
Unknown directive: =synopsis
- Around line 87:
Unknown directive: =description
- Around line 97:
Unknown directive: =method
- Around line 102:
Unknown directive: =signature
- Around line 106:
Unknown directive: =metadata
- Around line 142:
=cut found outside a pod block. Skipping to next block.
- Around line 160:
Unknown directive: =partials