summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-05-27 23:26:34 -0500
committerJesse Luehrs <doy@tozt.net>2009-05-27 23:26:34 -0500
commit40c7f553645447e3119e30176ef0e2396e6d01fd (patch)
tree43ef35747c2dd0792a22617b5d6ce61963206b67
parent16f57433a853f48a2ff59ede3a59c732fd4060ef (diff)
downloadmoosex-mangle-40c7f553645447e3119e30176ef0e2396e6d01fd.tar.gz
moosex-mangle-40c7f553645447e3119e30176ef0e2396e6d01fd.zip
document guard
-rw-r--r--lib/MooseX/Mangle.pm9
1 files changed, 9 insertions, 0 deletions
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<METHOD_NAME> to be
+called. C<CODE> is called as a method, receiving the arguments passed to the
+method. If C<CODE> 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) = @_;