MooX::Const - Syntactic sugar for creating constant Moo attributes
version v0.1.0
use Moo; use MooX::Const; has thing => ( is => 'const', isa => ArrayRef[HashRef], );
This is syntactic sugar for using Types::Const with Moo.
It modifies the has function to support "const" attributes. These are read-only ("ro") attributes for references, where the underlying data structure has been set as read-only.
has
This will return an error if there is no "isa", the "isa" is not a Type::Tiny type, if it is not a reference, or if it is blessed object.
Simple value types such as Int or Str are silently converted to read-only attributes.
Int
Str
Moo
Types::Const
Type::Tiny
The development version is on github at https://github.com/robrwo/MooX-Const and may be cloned from git://github.com/robrwo/MooX-Const.git
Please report any bugs or feature requests on the bugtracker website https://github.com/robrwo/MooX-Const/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Robert Rothenberg <rrwo@cpan.org>
This software is Copyright (c) 2018 by Robert Rothenberg.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install MooX::Const, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooX::Const
CPAN shell
perl -MCPAN -e shell install MooX::Const
For more information on module installation, please visit the detailed CPAN module installation guide.