https://github.com/mohawk2/moox-stricthas
Moo extension to catch Moose features not in Moo
https://github.com/mohawk2/moox-stricthas
Last synced: about 1 year ago
JSON representation
Moo extension to catch Moose features not in Moo
- Host: GitHub
- URL: https://github.com/mohawk2/moox-stricthas
- Owner: mohawk2
- Created: 2019-03-21T18:47:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-12T21:37:01.000Z (about 7 years ago)
- Last Synced: 2025-02-05T06:14:23.056Z (over 1 year ago)
- Language: Perl
- Homepage: https://metacpan.org/pod/MooX::StrictHas
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
# NAME
MooX::StrictHas - Forbid "has" attributes lazy\_build and auto\_deref
# PROJECT STATUS
| OS | Build status |
|:-------:|--------------:|
| Linux | [](https://travis-ci.org/mohawk2/moox-stricthas) |
[](https://metacpan.org/pod/MooX::StrictHas) [](https://coveralls.io/github/mohawk2/moox-stricthas?branch=master)
# SYNOPSIS
package MyMod;
use Moo;
use MooX::StrictHas;
has attr => (
is => 'ro',
auto_deref => 1, # blows up, not implemented in Moo
);
has attr2 => (
is => 'ro',
lazy_build => 1, # blows up, not implemented in Moo
);
has attr2 => (
is => 'ro',
does => "Thing", # blows up, not implemented in Moo
);
# DESCRIPTION
This is a [Moo](https://metacpan.org/pod/Moo) extension, intended to aid those porting modules from
[Moose](https://metacpan.org/pod/Moose) to Moo. It forbids two attributes for ["has" in Moo](https://metacpan.org/pod/Moo#has), which Moo
does not implement, but silently accepts:
- auto\_deref
This is not considered best practice - just dereference in your using code.
- does
Unsupported; use `isa` instead.
- lazy\_build
Use `is => 'lazy'` instead.
# AUTHOR
Ed J
# LICENCE
The same terms as Perl itself.