MooseX::PrivateSetters::Role::Attribute - Names setters as such, and makes them private
Moose::Exporter->setup_import_methods( class_metaroles => { attribute => ['MooseX::PrivateSetters::Role::Attribute'], }, );
This role applies a method modifier to the _process_options() method, and tweaks the writer parameters so that they are private with an explicit '_set_attr' method. Getters are left unchanged. This role copes with attributes intended to be private (ie, starts with an underscore), with no double-underscore in the setter.
_process_options()
For example:
| Code | Reader | Writer | |---------------------------+--------+-------------| | has 'baz' => (is 'rw'); | baz() | _set_baz() | | has 'baz' => (is 'ro'); | baz() | | | has '_baz' => (is 'rw'); | _baz() | _set_baz() | | has '__baz' => (is 'rw'); | _baz() | _set__baz() |
You probably don't want to use this module. You probably should be looking at MooseX::PrivateSetters instead.
brian greenfield <briang@cpan.org>
<briang@cpan.org>
Copyright 2010 brian greenfield
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install MooseX::PrivateSetters, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::PrivateSetters
CPAN shell
perl -MCPAN -e shell install MooseX::PrivateSetters
For more information on module installation, please visit the detailed CPAN module installation guide.