NAME
MooX::Press::Keywords - handy keywords for MooX::Press
SYNOPSIS
use MooX::Press::Keywords;
use MooX::Press (
class => [
'Leaf' => {
has => {
'colour' => {
is => rwp,
enum => [qw/ green red brown /],
default => 'green',
},
},
},
'Tree' => {
has => {
'species' => {
is => ro,
isa => Str,
required => true,
},
'foliage' => {
is => lazy,
isa => '@Leaf',
builder => sub { [] },
},
},
},
],
);
no MooX::Press::Keywords;
DESCRIPTION
This is just a quick way of importing:
strict and warnings. (
no MooX::Press::Keywordswon't unimport these!)Types::Standard, Types::Common::Numeric, and Types::Common::String.
trueandfalseboolean constants.ro,rw,rwp,lazy,private, andbarestring constants.blessedfrom Scalar::Util.confessfrom Carp.
You don't need to use it, but it might save a few lines of boilerplate code, and allow you to use some meaningful barewords instead of quoted strings and numbers.
BUGS
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=MooX-Press.
SEE ALSO
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT AND LICENCE
This software is copyright (c) 2020 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.