From 16f270e2eb646263a9712fe4b443e7a07e367064 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sun, 14 Feb 2010 18:00:29 +0100 Subject: POD and confess --- lib/MooseX/Privacy/Meta/Method/Private.pm | 28 +++++++++++++++++++++++++-- lib/MooseX/Privacy/Meta/Method/Protected.pm | 30 ++++++++++++++++++++++++++--- 2 files changed, 53 insertions(+), 5 deletions(-) (limited to 'lib/MooseX/Privacy') 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 Efranck@lumberjaph.netE + +=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 Efranck@lumberjaph.netE + +=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 -- cgit 1.4.1