summaryrefslogtreecommitdiff
path: root/lib/MooseX
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/MooseX/Privacy/Meta/Class/Private.pm94
-rw-r--r--lib/MooseX/Privacy/Meta/Class/Protected.pm93
2 files changed, 0 insertions, 187 deletions
diff --git a/lib/MooseX/Privacy/Meta/Class/Private.pm b/lib/MooseX/Privacy/Meta/Class/Private.pm
deleted file mode 100644
index c0907fa..0000000
--- a/lib/MooseX/Privacy/Meta/Class/Private.pm
+++ /dev/null
@@ -1,94 +0,0 @@
-package MooseX::Privacy::Meta::Class::Private;
-
-use Scalar::Util;
-use Carp qw/confess/;
-use Moose::Role;
-use MooseX::Types::Moose qw/Str ArrayRef/;
-use MooseX::Privacy::Meta::Method::Private;
-
-has local_private_methods => (
- traits => ['Array'],
- is => 'ro',
- isa => ArrayRef [Str],
- required => 1,
- default => sub { [] },
- auto_deref => 1,
- handles => { '_push_private_method' => 'push' },
-);
-
-has local_private_attributes => (
- traits => ['Array'],
- is => 'ro',
- isa => ArrayRef [Str],
- required => 1,
- default => sub { [] },
- auto_deref => 1,
- handles => { '_push_private_attribute' => 'push' },
-);
-
-sub add_private_method {
- my ( $self, $method_name, $method ) = @_;
-
- my $private_method
- = blessed $method
- ? $method
- : MooseX::Privacy::Meta::Method::Private->wrap(
- name => $method_name,
- package_name => $self->name,
- body => $method
- );
-
- confess 'not a private method'
- unless $private_method->isa('MooseX::Privacy::Meta::Method::Private');
-
- $self->add_method( $private_method->name, $private_method );
- $self->_push_private_method( $private_method->name );
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-MooseX::Privacy::Meta::Class::Private
-
-=head1 SYNOPSIS
-
-=head1 METHODS
-
-=head2 local_private_attributes
-
-Arrayref of all private attributes
-
- my $private_attributes = $self->meta->local_private_attributes;
-
-=head2 local_private_methods
-
-Arrayref of all private methods
-
- my $private_methods = $self->meta->local_private_methods;
-
-=head2 add_private_method
-
-Add a private method to your object.
-
- $object->meta->add_private_method('foo', sub { return 23 });
-
-or
-
- $object->meta->add_private_method('foo', MooseX::Privacy::Meta::Method::Private->wrap(name => 'foo', package_name => 'Foo', body => sub {return 23});
-
-=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/Class/Protected.pm b/lib/MooseX/Privacy/Meta/Class/Protected.pm
deleted file mode 100644
index cdd980e..0000000
--- a/lib/MooseX/Privacy/Meta/Class/Protected.pm
+++ /dev/null
@@ -1,93 +0,0 @@
-package MooseX::Privacy::Meta::Class::Protected;
-
-use Scalar::Util;
-use Carp qw/confess/;
-use Moose::Role;
-use MooseX::Types::Moose qw/Str ArrayRef/;
-use MooseX::Privacy::Meta::Method::Protected;
-
-has local_protected_methods => (
- traits => ['Array'],
- is => 'ro',
- isa => ArrayRef [Str],
- required => 1,
- default => sub { [] },
- auto_deref => 1,
- handles => { '_push_protected_method' => 'push' },
-);
-
-has local_protected_attributes => (
- traits => ['Array'],
- is => 'ro',
- isa => ArrayRef [Str],
- required => 1,
- default => sub { [] },
- auto_deref => 1,
- handles => { '_push_protected_attribute' => 'push' },
-);
-
-sub add_protected_method {
- my ( $self, $method_name, $method ) = @_;
-
- my $protected_method
- = blessed $method
- ? $method
- : MooseX::Privacy::Meta::Method::Protected->wrap(
- name => $method_name,
- package_name => $self->name,
- body => $method
- );
-
- confess $method_name . " is not a protected method"
- unless $protected_method->isa(
- 'MooseX::Privacy::Meta::Method::Protected');
-
- $self->add_method( $protected_method->name, $protected_method );
- $self->_push_protected_method( $protected_method->name );
-}
-
-1;
-__END__
-
-=head1 NAME
-
-MooseX::Privacy::Meta::Class::Protected
-
-=head1 SYNOPSIS
-
-=head1 METHODS
-
-=head2 local_protected_attributes
-
-Arrayref of all protected attributes
-
- my $protected_attributes = $self->meta->local_protected_attributes;
-
-=head2 local_protected_methods
-
-Arrayref of all protected methods
-
- my $protected_methods = $self->meta->local_protected_methods;
-
-=head2 add_protected_method
-
-Add a protected method to your object.
-
- $object->meta->add_protected_method('foo', sub { return 23 });
-
-or
-
- $object->meta->add_protected_method('foo', MooseX::Privacy::Meta::Method::Protected->wrap(name => 'foo', package_name => 'Foo', body => sub {return 23});
-
-=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