summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-02-14 18:00:29 +0100
committerfranck cuny <franck@lumberjaph.net>2010-02-14 18:00:29 +0100
commit16f270e2eb646263a9712fe4b443e7a07e367064 (patch)
tree8def06d8534db2fe3c190663e7d4230dcd04895f
parentadd_{private,protected}_method accept a MX::Private::Meta::Method::* instance... (diff)
downloadmoosex-privacy-16f270e2eb646263a9712fe4b443e7a07e367064.tar.gz
POD and confess
-rw-r--r--lib/MooseX/Privacy/Meta/Method/Private.pm28
-rw-r--r--lib/MooseX/Privacy/Meta/Method/Protected.pm30
2 files changed, 53 insertions, 5 deletions
diff --git a/lib/MooseX/Privacy/Meta/Method/Private.pm b/lib/MooseX/Privacy/Meta/Method/Private.pm
index d4df26f..e706e67 100644
--- a/lib/MooseX/Privacy/Meta/Method/Private.pm
+++ b/lib/MooseX/Privacy/Meta/Method/Private.pm
@@ -3,7 +3,7 @@ package MooseX::Privacy::Meta::Method::Private;
 use Moose;
 extends 'Moose::Meta::Method';
 
-use Carp;
+use Carp qw/confess/;
 
 sub wrap {
     my $class = shift;
@@ -11,7 +11,7 @@ sub wrap {
 
     my $method       = delete $args{body};
     my $private_code = sub {
-        croak "The "
+        confess "The "
             . $args{package_name} . "::"
             . $args{name}
             . " method is private"
@@ -24,3 +24,27 @@ sub wrap {
 }
 
 1;
+__END__
+
+=head1 NAME
+
+MooseX::Privacy::Meta::Method::Private
+
+=head1 SYNOPSIS
+
+=head1 METHODS
+
+=head2 wrap
+
+=head1 AUTHOR
+
+franck cuny E<lt>franck@lumberjaph.netE<gt>
+
+=head1 SEE ALSO
+
+=head1 LICENSE
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
diff --git a/lib/MooseX/Privacy/Meta/Method/Protected.pm b/lib/MooseX/Privacy/Meta/Method/Protected.pm
index 90a22e1..f76ac8e 100644
--- a/lib/MooseX/Privacy/Meta/Method/Protected.pm
+++ b/lib/MooseX/Privacy/Meta/Method/Protected.pm
@@ -3,7 +3,7 @@ package MooseX::Privacy::Meta::Method::Protected;
 use Moose;
 extends 'Moose::Meta::Method';
 
-use Carp;
+use Carp qw/confess/;
 
 sub wrap {
     my $class = shift;
@@ -12,10 +12,10 @@ sub wrap {
     my $method         = delete $args{body};
     my $protected_code = sub {
         my $caller = caller();
-        croak "The "
+        confess "The "
             . $args{package_name} . "::"
             . $args{name}
-            . " name method is private"
+            . " method is protected"
             unless $caller eq $args{package_name}
                 || $caller->isa( $args{package_name} );
 
@@ -26,4 +26,28 @@ sub wrap {
 }
 
 1;
+__END__
+
+=head1 NAME
+
+MooseX::Privacy::Meta::Method::Protected
+
+=head1 SYNOPSIS
+
+=head1 METHODS
+
+=head2 wrap
+
+=head1 AUTHOR
+
+franck cuny E<lt>franck@lumberjaph.netE<gt>
+
+=head1 SEE ALSO
+
+=head1 LICENSE
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut