From 40c7f553645447e3119e30176ef0e2396e6d01fd Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 27 May 2009 23:26:34 -0500 Subject: document guard --- lib/MooseX/Mangle.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/MooseX/Mangle.pm b/lib/MooseX/Mangle.pm index 9e1087f..3373745 100644 --- a/lib/MooseX/Mangle.pm +++ b/lib/MooseX/Mangle.pm @@ -95,6 +95,15 @@ sub mangle_return { }); } +=head2 guard METHOD_NAME CODE + +Provides a requirement that must be satisfied in order for C to be +called. C is called as a method, receiving the arguments passed to the +method. If C returns true, the method is called as normal, otherwise +undef is returned without the original method being called at all. + +=cut + sub guard { my $caller = shift; my ($method_name, $code) = @_; -- cgit v1.2.3