diff options
author | franck cuny <franck@lumberjaph.net> | 2010-03-01 22:17:49 +0100 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-03-01 22:17:49 +0100 |
commit | 64cab1daa8d6fe0182cef602be235a89f95987c7 (patch) | |
tree | bb5850cb365540931e02b1f08c445421169a9cd4 /lib/MooseX/Privacy/Trait/Protected.pm | |
parent | trait for protected and private attributes (diff) | |
download | moosex-privacy-64cab1daa8d6fe0182cef602be235a89f95987c7.tar.gz |
start to implement private and protected attributes
Diffstat (limited to '')
-rw-r--r-- | lib/MooseX/Privacy/Trait/Protected.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/MooseX/Privacy/Trait/Protected.pm b/lib/MooseX/Privacy/Trait/Protected.pm new file mode 100644 index 0000000..7a8037c --- /dev/null +++ b/lib/MooseX/Privacy/Trait/Protected.pm @@ -0,0 +1,15 @@ +package MooseX::Privacy::Trait::Protected; + +use Moose::Role; + +around accessor_metaclass => sub { + my ( $orig, $self, @rest ) = @_; + + return Moose::Meta::Class->create_anon_class( + superclasses => [ $self->$orig(@_) ], + roles => ['MooseX::Privacy::Meta::Attribute::Protected'], + cache => 1 + )->name; +}; + +1; |