From 5ea3d7d61698e071b8bebfb39ba8eafa9a5e8262 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Thu, 4 Mar 2010 06:16:58 +0100 Subject: rewrite --- lib/MooseX/Privacy/Meta/Attribute/Private.pm | 29 +++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'lib/MooseX/Privacy/Meta/Attribute/Private.pm') diff --git a/lib/MooseX/Privacy/Meta/Attribute/Private.pm b/lib/MooseX/Privacy/Meta/Attribute/Private.pm index 84f9d4f..e230b40 100644 --- a/lib/MooseX/Privacy/Meta/Attribute/Private.pm +++ b/lib/MooseX/Privacy/Meta/Attribute/Private.pm @@ -2,10 +2,17 @@ package MooseX::Privacy::Meta::Attribute::Private; use Moose::Role; use Carp qw/confess/; +use MooseX::Types::Moose qw/Str ArrayRef/; sub _generate_accessor_method { - my $attr = (shift)->associated_attribute; + my $self = shift; + my $attr = $self->associated_attribute; + my $package_name = $attr->associated_class->name; + my $class = $attr->associated_class->name->meta; + if ( $class->meta->has_attribute('local_private_attributes') ) { + $class->_push_private_attribute( $attr->name ); + } return sub { my $self = shift; @@ -19,3 +26,23 @@ sub _generate_accessor_method { } 1; +__END__ + +=head1 NAME + +MooseX::Privacy::Meta::Attribute::Private + +=head1 SYNOPSIS + +=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 v1.2.3