mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-20 18:17:59 -04:00
25 lines
532 B
Plaintext
25 lines
532 B
Plaintext
MooseX::Has::Options provides a succinct syntax for declaring options for
|
|
Moose attributes. It hijacks the has function imported by Moose and replaces
|
|
it with one that understands following options syntax:
|
|
|
|
use Moose;
|
|
use MooseX::Has::Options;
|
|
|
|
has 'some_attribute' => (
|
|
qw(:ro :required),
|
|
isa => 'Str',
|
|
...
|
|
);
|
|
|
|
This will converted into:
|
|
|
|
use Moose;
|
|
use MooseX::Has::Options;
|
|
|
|
has 'some_attribute' => (
|
|
is => 'ro',
|
|
required => 1,
|
|
isa => 'Str',
|
|
...
|
|
);
|