Skip to content

Csson/p5-Kavorka-TraitFor-Parameter-doc

Repository files navigation

NAME

Kavorka::TraitFor::Parameter::doc - Document method parameters in the signature

Requires Perl 5.14+ coverage 100.0% Build status at Github

VERSION

Version 0.1105, released 2021-02-28.

SYNOPSIS

# The class
use Moops;

class My::Class using Moose {

    method square(Int $integer does doc('The integer to square.')) {

        return $integer * $integer;

    }

}

# Elsewhere
my $param = My::Class->meta->get_method('square')->signature->params->[1];
say sprintf '%s %s. %s', $param->optional ? 'Optional' : 'Required',
                         $param->type->name,
                         $param->traits->{'doc'}[0];

# says 'Required Int. The integer to square.'

DESCRIPTION

Kavorka::TraitFor::Parameter::doc adds a trait (doc) that is useful for documenting in Moops classes created using Moose.

SEE ALSO

SOURCE

https://github.com/Csson/p5-Kavorka-TraitFor-Parameter-doc

HOMEPAGE

https://metacpan.org/release/Kavorka-TraitFor-Parameter-doc

AUTHOR

Erik Carlsson info@code301.com

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages