MooseX::AttributeDocumented::Meta::Attribute::Trait::Documented - Add documentation to attributes
Version 0.1004, released 2019-01-30.
use Moose; has gears => ( is => 'ro', isa => 'Int', default => 21, traits => ['Documented'], documentation => 'Number of gears on the bike', documentation_order => 2, ); has has_brakes => ( is => 'ro', isa => 'Bool', default => 1, traits => ['Documented'], documentation => 'Does the bike have brakes?', documentation_alts => { 0 => 'Hopefully a track bike', 1 => 'Always nice to have', }, ); has undocumented_attr => ( is => 'ro', isa => Str, default => 'other', );
Moose already has documentation, this trait adds the following to the attribute specification:
documentation
A hash reference. Describe the effect of different values, eg. on booleans.
A string. If the default value is a code ref you can describe it in this field.
An integer. Defaults to 1000.
1000
https://github.com/Csson/p5-MooseX-AttributeDocumented
https://metacpan.org/release/MooseX-AttributeDocumented
Erik Carlsson <info@code301.com>
This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install MooseX::AttributeDocumented, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::AttributeDocumented
CPAN shell
perl -MCPAN -e shell install MooseX::AttributeDocumented
For more information on module installation, please visit the detailed CPAN module installation guide.