MooseX::Role::Restricted - (DEPRECATED) Restrict which sub are exported by a role


MooseX-Role-Restricted documentation  | view source Contained in the MooseX-Role-Restricted distribution.

Index


NAME

Top

  MooseX::Role::Restricted - (DEPRECATED) Restrict which sub are exported by a role

SYNOPSIS

Top

  package MyApp::MyRole;

  use MooseX::Role::Restricted;

  sub method1 { ... }
  sub _private1 { ... }

  sub _method2 :Public { ... }
  sub private2 :Private { ... }

DEPRECATED

Top

This module is no longer supported. I suggest looking at namespace::autoclean as an alternative. In its default form MooseX::Role::Restricted simple excludes ann sub with names starting with _ to be excluded. This can be accomplished using

  use namespace::autoclean -also => qr/^_/;

If you are using lazy_build or other Moose features that require the use of _ prefixed methods make sure to change the pattern to not match those. Or use some other prefix, for example a double _, for your private subs that you do not want included in the role.

DESCRIPTION

Top

By default Moose::Role will export any sub you define in a role package. However it does not export any sub which was imported from another package

MooseX::Role::Restricted give a little more control over which subs are exported and which are not.

By default an sub with a name starting with _ is considered private and will not be exported. However MooseX::Role::Restricted provides two subroutine attributes :Public and :Private which can control is any sub is exported or kept private

SEE ALSO

Top

Moose::Role

AUTHOR

Top

Graham Barr <gbarr@cpan.org>

COPYRIGHT & LICENSE

Top


MooseX-Role-Restricted documentation  | view source Contained in the MooseX-Role-Restricted distribution.